1 | <?php |
||
17 | class hash |
||
18 | { |
||
19 | /** |
||
20 | * Recursively search a hash for a key-path and return its value or the default value if the key-path is not found. |
||
21 | * @param $path |
||
22 | * @param $hash |
||
23 | * @param null $default |
||
24 | * @return mixed|null |
||
25 | */ |
||
26 | 2 | public static function get($path, $hash, $default = null) |
|
35 | |||
36 | /** |
||
37 | * Check if a key-path is defined in the hash. |
||
38 | * @param $path |
||
39 | * @param $hash |
||
40 | * @return bool |
||
41 | */ |
||
42 | 1 | public static function exists($path, $hash) |
|
50 | |||
51 | 3 | private static function escape($name) { |
|
54 | |||
55 | 2 | private static function unescape($name) { |
|
58 | |||
59 | /** |
||
60 | * Parse a variable name like 'name[index][index2]' to a key-path like '/name/index/index2/' |
||
61 | * @param $name |
||
62 | * @return string |
||
63 | */ |
||
64 | 2 | public static function parseName($name) |
|
80 | |||
81 | /** |
||
82 | * Compile a key-path like '/name/index/index2/' to a variable name like 'name[index][index2]' |
||
83 | * @param $path |
||
84 | * @param string $root |
||
85 | * @return mixed |
||
86 | */ |
||
87 | public static function compileName($path, $root = '') |
||
94 | |||
95 | /** |
||
96 | * Generate a NamedNode tree from a hash. |
||
97 | * @param $hash |
||
98 | * @param null $parent |
||
99 | * @return tree\NamedNode|null |
||
100 | */ |
||
101 | 1 | public static function tree($hash, $parent = null) |
|
121 | } |
||
122 |
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: