| 1 | <?php |
||
| 19 | trait ExtendedArrayTrait |
||
| 20 | { |
||
| 21 | use StringTrait; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @param array $array |
||
| 25 | * @param Integer $spaces |
||
| 26 | * @return string |
||
| 27 | */ |
||
| 28 | 11 | public function arrayToCommaString(array $array, Integer $spaces) |
|
| 32 | |||
| 33 | /** |
||
| 34 | * @param $json |
||
| 35 | * @return array |
||
| 36 | */ |
||
| 37 | 3 | public static function getArrayUsingJsonNotation($json) |
|
| 41 | |||
| 42 | /** |
||
| 43 | * Get an item from an array using "dot" notation. |
||
| 44 | * |
||
| 45 | * @param array $array |
||
| 46 | * @param string $key |
||
|
|
|||
| 47 | * @param mixed $default |
||
| 48 | * |
||
| 49 | * @return mixed |
||
| 50 | */ |
||
| 51 | 2 | public static function getFromArrayUsingJsonNotation( |
|
| 73 | |||
| 74 | /** |
||
| 75 | * @param array $array |
||
| 76 | * @param bool|false $key |
||
| 77 | * @return null |
||
| 78 | */ |
||
| 79 | public static function nullIfNotSet(array $array, $key = false) |
||
| 83 | |||
| 84 | /** |
||
| 85 | * @param array $array |
||
| 86 | * @param bool|false $key |
||
| 87 | * @return bool |
||
| 88 | */ |
||
| 89 | public static function falseIfNotSet(array $array, $key = false) |
||
| 93 | } |
||
| 94 |
This check looks for
@paramannotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.