Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
HandlerChain Class Reference
Inheritance diagram for HandlerChain:
HandlerInterface

Public Member Functions

 __construct (TMapFactory $tmapFactory, array $handlers=[])
 
 handle (array $handlingSubject, array $response)
 

Detailed Description

Definition at line 17 of file HandlerChain.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( TMapFactory  $tmapFactory,
array  $handlers = [] 
)
Parameters
TMapFactory$tmapFactory
array$handlers

Definition at line 28 of file HandlerChain.php.

31  {
32  $this->handlers = $tmapFactory->create(
33  [
34  'array' => $handlers,
35  'type' => HandlerInterface::class
36  ]
37  );
38  }

Member Function Documentation

◆ handle()

handle ( array  $handlingSubject,
array  $response 
)

Handles response

Parameters
array$handlingSubject
array$response
Returns
void

Implements HandlerInterface.

Definition at line 47 of file HandlerChain.php.

48  {
49  foreach ($this->handlers as $handler) {
50  // @TODO implement exceptions catching
51  $handler->handle($handlingSubject, $response);
52  }
53  }
$response
Definition: 404.php:11
catch(\Exception $e) $handler
Definition: index.php:30

The documentation for this class was generated from the following file: