Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
RenderersPool.php
Go to the documentation of this file.
1 <?php
7 
8 class RenderersPool implements PoolInterface
9 {
13  private $renderers;
14 
18  public function __construct(
19  array $renderers = []
20  ) {
21  array_walk(
22  $renderers,
23  function (RendererInterface $renderer) {
24  return $renderer;
25  }
26  );
27 
28  $this->renderers = $renderers;
29  }
30 
37  public function get($rendererCode)
38  {
39  return !isset($this->renderers[$rendererCode])
40  ? null
41  :$this->renderers[$rendererCode];
42  }
43 }