Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
HandlerChain.php
Go to the documentation of this file.
1 <?php
7 
10 
18 {
22  private $handlers;
23 
28  public function __construct(
29  TMapFactory $tmapFactory,
30  array $handlers = []
31  ) {
32  $this->handlers = $tmapFactory->create(
33  [
34  'array' => $handlers,
35  'type' => HandlerInterface::class
36  ]
37  );
38  }
39 
47  public function handle(array $handlingSubject, array $response)
48  {
49  foreach ($this->handlers as $handler) {
50  // @TODO implement exceptions catching
51  $handler->handle($handlingSubject, $response);
52  }
53  }
54 }
$response
Definition: 404.php:11
__construct(TMapFactory $tmapFactory, array $handlers=[])
handle(array $handlingSubject, array $response)
catch(\Exception $e) $handler
Definition: index.php:30