1 | <?php |
||
17 | class PopupTwigExtension extends AbstractExtension |
||
18 | { |
||
19 | /** |
||
20 | * @var PopupManager |
||
21 | */ |
||
22 | private $popupManager; |
||
23 | |||
24 | /** |
||
25 | * @var ContainerInterface |
||
26 | */ |
||
27 | private $container; |
||
28 | |||
29 | /** |
||
30 | * @var array |
||
31 | */ |
||
32 | private $popupTypes; |
||
33 | |||
34 | /** |
||
35 | * @var bool |
||
36 | */ |
||
37 | private $debug; |
||
38 | |||
39 | /** |
||
40 | * @param PopupManager $popupManager |
||
41 | * @param ContainerInterface $container |
||
42 | * @param array $popupTypes |
||
43 | * @param bool $debug |
||
44 | */ |
||
45 | public function __construct(PopupManager $popupManager, ContainerInterface $container, array $popupTypes, $debug) |
||
52 | |||
53 | /** |
||
54 | * Returns a list of functions to add to the existing list. |
||
55 | * |
||
56 | * @return array An array of functions |
||
|
|||
57 | */ |
||
58 | public function getFunctions() |
||
69 | |||
70 | /** |
||
71 | * @return string |
||
72 | */ |
||
73 | public function renderJsIncludes(Environment $environment) |
||
79 | |||
80 | /** |
||
81 | * @return string |
||
82 | */ |
||
83 | public function renderPopupsHtml(Environment $environment) |
||
89 | |||
90 | /** |
||
91 | * @return string |
||
92 | */ |
||
93 | public function renderInitializeJs(Environment $environment) |
||
99 | |||
100 | /** |
||
101 | * @param AbstractRule $rule |
||
102 | * |
||
103 | * @return array |
||
104 | */ |
||
105 | public function getRuleProperties(AbstractRule $rule) |
||
117 | |||
118 | /** |
||
119 | * Get the available popup types. |
||
120 | * |
||
121 | * @return array |
||
122 | */ |
||
123 | public function getAvailablePopupTypes() |
||
133 | |||
134 | /** |
||
135 | * Get the available popup types for a specific popup. |
||
136 | * |
||
137 | * @param AbstractPopup $popup |
||
138 | * |
||
139 | * @return array |
||
140 | */ |
||
141 | public function getAvailableRuleTypes(AbstractPopup $popup) |
||
153 | } |
||
154 |
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.