@@ -57,8 +57,7 @@ discard block |
||
| 57 | 57 | * Class Arr |
| 58 | 58 | * @package Platine\Stdlib\Helper |
| 59 | 59 | */ |
| 60 | -class Arr |
|
| 61 | -{ |
|
| 60 | +class Arr { |
|
| 62 | 61 | |
| 63 | 62 | /** |
| 64 | 63 | * Convert an array, object or string to array |
@@ -159,8 +158,7 @@ discard block |
||
| 159 | 158 | * @return mixed If the key does not exist in the array or object, |
| 160 | 159 | * the default value will be returned instead. |
| 161 | 160 | */ |
| 162 | - public static function getValue($object, $key, $default = null) |
|
| 163 | - { |
|
| 161 | + public static function getValue($object, $key, $default = null) { |
|
| 164 | 162 | if ($key instanceof Closure) { |
| 165 | 163 | return $key($object, $default); |
| 166 | 164 | } |
@@ -220,8 +218,7 @@ discard block |
||
| 220 | 218 | * |
| 221 | 219 | * @return mixed|null |
| 222 | 220 | */ |
| 223 | - public static function remove(array &$array, $key, $default = null) |
|
| 224 | - { |
|
| 221 | + public static function remove(array &$array, $key, $default = null) { |
|
| 225 | 222 | if (isset($array[$key]) || array_key_exists($key, $array)) { |
| 226 | 223 | $value = $array[$key]; |
| 227 | 224 | |
@@ -296,8 +293,7 @@ discard block |
||
| 296 | 293 | * @param mixed $default |
| 297 | 294 | * @return mixed |
| 298 | 295 | */ |
| 299 | - public static function pull(array &$array, $key, $default = null) |
|
| 300 | - { |
|
| 296 | + public static function pull(array &$array, $key, $default = null) { |
|
| 301 | 297 | $value = static::get($array, $key, $default); |
| 302 | 298 | |
| 303 | 299 | static::forget($array, $key); |
@@ -756,8 +752,7 @@ discard block |
||
| 756 | 752 | * @param mixed $default |
| 757 | 753 | * @return mixed |
| 758 | 754 | */ |
| 759 | - public static function get($array, $key = null, $default = null) |
|
| 760 | - { |
|
| 755 | + public static function get($array, $key = null, $default = null) { |
|
| 761 | 756 | if ($key === null) { |
| 762 | 757 | return $array; |
| 763 | 758 | } |
@@ -1137,8 +1132,7 @@ discard block |
||
| 1137 | 1132 | * |
| 1138 | 1133 | * @return mixed |
| 1139 | 1134 | */ |
| 1140 | - public static function random(array $array, ?int $number = null) |
|
| 1141 | - { |
|
| 1135 | + public static function random(array $array, ?int $number = null) { |
|
| 1142 | 1136 | $requested = $number === null ? 1 : $number; |
| 1143 | 1137 | $count = count($array); |
| 1144 | 1138 | |