1 | <?php |
||
13 | class TbArray |
||
14 | { |
||
15 | /** |
||
16 | * Returns a specific value from the given array (or the default value if not set). |
||
17 | * @param string $key the item key. |
||
18 | * @param array $array the array to get from. |
||
19 | * @param mixed $defaultValue the default value. |
||
20 | * @return mixed the value. |
||
21 | */ |
||
22 | public static function getValue($key, array $array, $defaultValue = null) |
||
26 | |||
27 | /** |
||
28 | * Removes and returns a specific value from the given array (or the default value if not set). |
||
29 | * @param string $key the item key. |
||
30 | * @param array $array the array to pop the item from. |
||
31 | * @param mixed $defaultValue the default value. |
||
32 | * @return mixed the value. |
||
33 | */ |
||
34 | public static function popValue($key, array &$array, $defaultValue = null) |
||
40 | |||
41 | /** |
||
42 | * Sets the default value for a specific key in the given array. |
||
43 | * @param string $key the item key. |
||
44 | * @param mixed $value the default value. |
||
45 | * @param array $array the array. |
||
46 | */ |
||
47 | public static function defaultValue($key, $value, array &$array) |
||
53 | |||
54 | /** |
||
55 | * Sets a set of default values for the given array. |
||
56 | * @param array $array the array to set values for. |
||
57 | * @param array $values the default values. |
||
58 | */ |
||
59 | public static function defaultValues(array $values, array &$array) |
||
65 | |||
66 | /** |
||
67 | * Removes a specific value from the given array. |
||
68 | * @param string $key the item key. |
||
69 | */ |
||
70 | public static function removeValue($key, array &$array) |
||
74 | |||
75 | /** |
||
76 | * Removes a set of items from the given array. |
||
77 | * @param string[] $keys the keys to remove. |
||
78 | * @param array $array the array to remove from. |
||
79 | */ |
||
80 | public static function removeValues(array $keys, array &$array) |
||
84 | |||
85 | /** |
||
86 | * Copies the given values from one array to another. |
||
87 | * @param string[] $keys the keys to copy. |
||
88 | * @param array $from the array to copy from. |
||
89 | * @param array $to the array to copy to. |
||
90 | * @param boolean $force whether to allow overriding of existing values. |
||
91 | * @return array the options. |
||
92 | */ |
||
93 | public static function copyValues(array $keys, array $from, array $to, $force = false) |
||
104 | |||
105 | /** |
||
106 | * Moves the given values from one array to another. |
||
107 | * @param array $keys the keys to move. |
||
108 | * @param array $from the array to move from. |
||
109 | * @param array $to the array to move to. |
||
110 | * @param boolean $force whether to allow overriding of existing values. |
||
111 | * @return array the options. |
||
112 | */ |
||
113 | public static function moveValues(array $keys, array &$from, array $to, $force = false) |
||
126 | |||
127 | /** |
||
128 | * Merges two arrays. |
||
129 | * @param array $to array to be merged to. |
||
130 | * @param array $from array to be merged from. |
||
131 | * @return array the merged array. |
||
132 | */ |
||
133 | public static function merge(array $to, array $from) |
||
151 | } |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.