| Total Complexity | 3 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class ListExtension extends AbstractExtension |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @var ListRenderer |
||
| 18 | */ |
||
| 19 | private $renderer; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * ListExtension constructor. |
||
| 23 | * |
||
| 24 | * @param ListRenderer $renderer |
||
| 25 | */ |
||
| 26 | 2 | public function __construct(ListRenderer $renderer) |
|
| 27 | { |
||
| 28 | 2 | $this->renderer = $renderer; |
|
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @inheritdoc |
||
| 33 | */ |
||
| 34 | 1 | public function getFunctions(): array |
|
| 35 | { |
||
| 36 | 1 | return [ |
|
| 37 | 1 | new TwigFunction( |
|
| 38 | 1 | 'list_view', |
|
| 39 | 1 | Closure::fromCallable([$this, 'listView']), |
|
| 40 | 1 | ['is_safe' => ['html'], 'needs_context' => true] |
|
| 41 | 1 | ), |
|
| 42 | 1 | ]; |
|
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @param array $context |
||
| 47 | * @param ViewInterface $view |
||
| 48 | * @param string $blockName |
||
| 49 | * @param bool $rewritable |
||
| 50 | * |
||
| 51 | * @return string |
||
| 52 | */ |
||
| 53 | 1 | public function listView( |
|
| 60 | } |
||
| 61 | } |
||
| 62 |