Total Complexity | 5 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | class TwigExtension extends AbstractExtension |
||
24 | { |
||
25 | private $widgetFactory; |
||
26 | |||
27 | 1 | public function __construct(WidgetFactoryInterface $widgetFactory) |
|
30 | 1 | } |
|
31 | |||
32 | 1 | public function getFunctions() |
|
33 | { |
||
34 | return [ |
||
35 | 1 | new TwigFunction( |
|
36 | 1 | 'widget', |
|
37 | 1 | [$this, 'widget'], |
|
38 | [ |
||
39 | 1 | 'is_safe' => ['html'], |
|
40 | ] |
||
41 | ) |
||
42 | ]; |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * @throws Exception |
||
47 | * @throws PropertyNotAccessibleException |
||
48 | */ |
||
49 | 1 | public function widget(string $name, array $options = [], array $extenstionOptions = []): string |
|
61 | } |
||
62 | } |
||
64 |