Total Complexity | 5 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
12 | class BaseDataSource extends \Twig_Extension |
||
|
|||
13 | { |
||
14 | protected const TWIG_FUNCTION_SUFFIX = 'Provider'; |
||
15 | |||
16 | /** |
||
17 | * @return array |
||
18 | */ |
||
19 | public function getFunctions() |
||
20 | { |
||
21 | $functions = []; |
||
22 | $class = new \ReflectionClass(get_class($this)); |
||
23 | |||
24 | if (self::class === $class->name) { |
||
25 | return $functions; |
||
26 | } |
||
27 | |||
28 | foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) { |
||
29 | if (false === ($offset = strpos($method->getName(), self::TWIG_FUNCTION_SUFFIX))) { |
||
30 | continue; |
||
31 | } |
||
32 | |||
33 | $functions[] = $this->registerAsTwigFunction(substr($method->getName(), 0, $offset)); |
||
34 | } |
||
35 | |||
36 | return $functions; |
||
37 | } |
||
38 | |||
39 | private function registerAsTwigFunction(string $name): ?\Twig_SimpleFunction |
||
42 | } |
||
43 | } |
||
44 |
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