Conditions | 3 |
Paths | 6 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | function phpstan_magento2_autoloader($class) |
||
15 | { |
||
16 | global $_git_hook_loaded_class; |
||
17 | if (isset($_git_hook_loaded_class[$class])) { |
||
18 | return $_git_hook_loaded_class[$class]; |
||
19 | } |
||
20 | |||
21 | try { |
||
22 | /* Get Magento ObjectManager */ |
||
23 | $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER); |
||
24 | $objectManager = $bootstrap->getObjectManager(); |
||
25 | |||
26 | $objectManager->get($class); |
||
27 | $_git_hook_loaded_class[$class] = true; |
||
28 | } catch (\Exception $e) { |
||
29 | $_git_hook_loaded_class[$class] = false; |
||
30 | } |
||
31 | |||
32 | return $_git_hook_loaded_class[$class]; |
||
33 | } |
||
37 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths