1 | <?php |
||
18 | class Main |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * An array of TWIG instances keyed by a file directory |
||
23 | * @var array |
||
24 | */ |
||
25 | protected $twig = array(); |
||
26 | |||
27 | /** |
||
28 | * Module class instance |
||
29 | * @var \gplcart\core\Module $module |
||
30 | */ |
||
31 | protected $module; |
||
32 | |||
33 | /** |
||
34 | * Library class instance |
||
35 | * @var \gplcart\core\Library $library |
||
36 | */ |
||
37 | protected $library; |
||
38 | |||
39 | /** |
||
40 | * @param Module $module |
||
41 | * @param Library $library |
||
42 | */ |
||
43 | public function __construct(Module $module, Library $library) |
||
48 | |||
49 | /** |
||
50 | * Implements hook "library.list" |
||
51 | * @param array $libraries |
||
52 | */ |
||
53 | public function hookLibraryList(array &$libraries) |
||
72 | |||
73 | /** |
||
74 | * Implements hook "route.list" |
||
75 | * @param array $routes |
||
76 | */ |
||
77 | public function hookRouteList(array &$routes) |
||
86 | |||
87 | /** |
||
88 | * Implements hook "template.render" |
||
89 | * @param array $templates |
||
90 | * @param array $data |
||
91 | * @param null|string $rendered |
||
92 | * @param \gplcart\core\Controller $controller |
||
93 | */ |
||
94 | public function hookTemplateRender($templates, $data, &$rendered, $controller) |
||
98 | |||
99 | /** |
||
100 | * Implements hook "module.enable.after" |
||
101 | */ |
||
102 | public function hookModuleEnableAfter() |
||
106 | |||
107 | /** |
||
108 | * Implements hook "module.disable.after" |
||
109 | */ |
||
110 | public function hookModuleDisableAfter() |
||
114 | |||
115 | /** |
||
116 | * Implements hook "module.install.after" |
||
117 | */ |
||
118 | public function hookModuleInstallAfter() |
||
122 | |||
123 | /** |
||
124 | * Implements hook "module.uninstall.after" |
||
125 | */ |
||
126 | public function hookModuleUninstallAfter() |
||
130 | |||
131 | /** |
||
132 | * Returns a TWIG instance for the given file directory |
||
133 | * @param string $path |
||
134 | * @param \gplcart\core\Controller $controller |
||
135 | * @return \Twig_Environment |
||
136 | * @throws \InvalidArgumentException |
||
137 | */ |
||
138 | public function getTwigInstance($path, $controller) |
||
171 | |||
172 | /** |
||
173 | * Renders a .twig template |
||
174 | * @param string $template |
||
175 | * @param array $data |
||
176 | * @param \gplcart\core\Controller $controller |
||
177 | * @return string |
||
178 | */ |
||
179 | public function render($template, $data, $controller) |
||
191 | |||
192 | /** |
||
193 | * Validate a TWIG template syntax |
||
194 | * @param string $file |
||
195 | * @param \gplcart\core\Controller $controller |
||
196 | * @return boolean|string |
||
197 | */ |
||
198 | public function validate($file, $controller) |
||
210 | |||
211 | /** |
||
212 | * Sets rendered .twig template |
||
213 | * @param array $templates |
||
214 | * @param array $data |
||
215 | * @param null|string $rendered |
||
216 | * @param \gplcart\core\Controller $controller |
||
217 | */ |
||
218 | protected function setRenderedTemplate($templates, $data, &$rendered, $controller) |
||
228 | |||
229 | /** |
||
230 | * Adds custom functions and returns an array of Twig_SimpleFunction objects |
||
231 | * @param \gplcart\core\Controller $controller |
||
232 | * @return array |
||
233 | */ |
||
234 | protected function getDefaultFunctions($controller) |
||
288 | |||
289 | } |
||
290 |
This error could be the result of:
1. Missing dependencies
PHP Analyzer uses your
composer.json
file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects thecomposer.json
to be in the root folder of your repository.Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the
require
orrequire-dev
section?2. Missing use statement
PHP does not complain about undefined classes in
ìnstanceof
checks. For example, the following PHP code will work perfectly fine:If you have not tested against this specific condition, such errors might go unnoticed.