1 | <?php |
||
22 | class ArrayHelper { |
||
23 | |||
24 | /** |
||
25 | * Get a value. |
||
26 | * |
||
27 | * @param array $array The array. |
||
28 | * @param mixed $key The key. |
||
29 | * @param mixed $default The default value. |
||
30 | * @return mixed Returns the value in case of success, $default otherwise. |
||
31 | */ |
||
32 | public static function get(array $array, $key, $default = null) { |
||
35 | |||
36 | /** |
||
37 | * Determines if a value is an array. |
||
38 | * |
||
39 | * @param mixed $value The value. |
||
40 | * @return void |
||
41 | * @throws ArrayArgumentException Throws an Array argument exception if the value is not of expected type. |
||
42 | */ |
||
43 | public static function isArray($value) { |
||
48 | |||
49 | /** |
||
50 | * Determines if an array is an object. |
||
51 | * |
||
52 | * @param array $array The array. |
||
53 | * @return bool Returns true in case of success, false otherwise. |
||
54 | */ |
||
55 | public static function isObject(array $array) { |
||
58 | |||
59 | /** |
||
60 | * Set a value. |
||
61 | * |
||
62 | * @param array $array The array. |
||
63 | * @param string $key The key. |
||
64 | * @param mixed $value The value. |
||
65 | * @param array $tests The tests. |
||
66 | * @return void |
||
67 | */ |
||
68 | public static function set(array &$array, $key, $value, array $tests = []) { |
||
77 | } |
||
78 |