1 | <?php |
||
10 | final class TreeScanner |
||
11 | { |
||
12 | /** |
||
13 | * Return all sections (app & plugins) with an Template directory. |
||
14 | * |
||
15 | * @return array |
||
16 | */ |
||
17 | 2 | public static function all(): array |
|
21 | |||
22 | /** |
||
23 | * Return all templates for a given plugin. |
||
24 | * |
||
25 | * @param string $plugin The plugin to find all templates for. |
||
26 | * |
||
27 | * @return mixed |
||
28 | */ |
||
29 | 1 | public static function plugin($plugin) |
|
35 | |||
36 | /** |
||
37 | * Strip the absolute path of template's paths for all given sections. |
||
38 | * |
||
39 | * @param string $sections Sections to iterate over. |
||
40 | * |
||
41 | * @return array |
||
42 | */ |
||
43 | 3 | protected static function deepen($sections): array |
|
51 | |||
52 | /** |
||
53 | * Turn a set of paths into a tree. |
||
54 | * |
||
55 | * @param array $paths Paths to turn into a tree. |
||
56 | * |
||
57 | * @return array |
||
58 | */ |
||
59 | 3 | protected static function convertToTree(array $paths): array |
|
67 | |||
68 | /** |
||
69 | * Convert a path into a tree when it contains a directory separator. |
||
70 | * |
||
71 | * @param array $paths The paths to work on. |
||
72 | * @param mixed $index Index of $path. |
||
73 | * @param string $path Path to breakup and turn into a tree. |
||
74 | * |
||
75 | */ |
||
76 | 3 | protected static function convertPathToTree(array &$paths, $index, $path) |
|
84 | |||
85 | /** |
||
86 | * Create a branch for the current level and push a twig on it. |
||
87 | * |
||
88 | * @param array $paths Paths to append. |
||
89 | * @param array $branches Branches to use untill only one left. |
||
90 | * |
||
91 | * @return array |
||
92 | */ |
||
93 | 3 | protected static function branch(array $paths, array $branches): array |
|
110 | } |
||
111 |
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: