1 | <?php |
||
9 | class TreeScanner |
||
10 | { |
||
11 | /** |
||
12 | * Return all sections (app & plugins) with an Template directory. |
||
13 | * |
||
14 | * @return array |
||
15 | */ |
||
16 | 2 | public static function all() |
|
20 | |||
21 | /** |
||
22 | * Return all templates for a given plugin. |
||
23 | * |
||
24 | * @param string $plugin The plugin to find all templates for. |
||
25 | * |
||
26 | * @return mixed |
||
27 | */ |
||
28 | 1 | public static function plugin($plugin) |
|
34 | |||
35 | /** |
||
36 | * Strip the absolute path of template's paths for all given sections. |
||
37 | * |
||
38 | * @param string $sections Sections to iterate over. |
||
39 | * |
||
40 | * @return array |
||
41 | */ |
||
42 | 3 | protected static function deepen($sections) |
|
49 | |||
50 | /** |
||
51 | * Turn a set of paths into a tree. |
||
52 | * |
||
53 | * @param array $paths Paths to turn into a tree. |
||
54 | * |
||
55 | * @return array |
||
56 | */ |
||
57 | 3 | protected static function convertToTree(array $paths) |
|
65 | |||
66 | /** |
||
67 | * Convert a path into a tree when it contains a directory separator. |
||
68 | * |
||
69 | * @param array $paths The paths to work on. |
||
70 | * @param mixed $index Index of $path. |
||
71 | * @param string $path Path to breakup and turn into a tree. |
||
72 | * |
||
73 | * @return void |
||
74 | */ |
||
75 | 2 | protected static function convertPathToTree(array &$paths, $index, $path) |
|
83 | |||
84 | /** |
||
85 | * Create a branch for the current level and push a twig on it. |
||
86 | * |
||
87 | * @param array $paths Paths to append. |
||
88 | * @param array $branches Branches to use untill only one left. |
||
89 | * |
||
90 | * @return array |
||
91 | */ |
||
92 | 2 | protected static function branch(array $paths, array $branches) |
|
108 | } |
||
109 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: