1 | <?php |
||
18 | trait ExtendedArrayTrait |
||
19 | { |
||
20 | use StringTrait; |
||
21 | |||
22 | /** |
||
23 | * @param array $array |
||
24 | * @param Integer $spaces |
||
25 | * @return string |
||
26 | */ |
||
27 | public function arrayToCommaString(array $array, $spaces) |
||
31 | |||
32 | /** |
||
33 | * @param array $array |
||
34 | * @return string |
||
35 | */ |
||
36 | public function arrayToPairString(array $array) |
||
42 | |||
43 | /** |
||
44 | * @param array $array |
||
45 | * @return array |
||
46 | */ |
||
47 | public function arrayToAttributeArray(array $array) |
||
53 | |||
54 | /** |
||
55 | * @param $json |
||
56 | 2 | * @return array |
|
57 | 1 | */ |
|
58 | public static function getArrayUsingJsonNotation($json) |
||
62 | |||
63 | /** |
||
64 | 2 | * Get an item from an array using "dot" notation. |
|
65 | 2 | * |
|
66 | 1 | * @param array $array |
|
67 | * @param string $key |
||
68 | 2 | * @param mixed $default |
|
69 | 2 | * |
|
70 | * @return mixed |
||
71 | 2 | */ |
|
72 | public static function getFromArrayUsingJsonNotation( |
||
94 | |||
95 | /** |
||
96 | * @param array $array |
||
97 | * @param bool|false $key |
||
98 | * @return null |
||
99 | */ |
||
100 | public static function nullIfNotSet(array $array, $key = false) |
||
104 | |||
105 | /** |
||
106 | * @param array $array |
||
107 | * @param bool|false $key |
||
108 | * @return bool |
||
109 | */ |
||
110 | public static function falseIfNotSet(array $array, $key = false) |
||
114 | } |
||
115 |
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: