@@ -52,8 +52,7 @@ |
||
| 52 | 52 | * Class Json |
| 53 | 53 | * @package Platine\Stdlib\Helper |
| 54 | 54 | */ |
| 55 | -class Json |
|
| 56 | -{ |
|
| 55 | +class Json { |
|
| 57 | 56 | |
| 58 | 57 | /** |
| 59 | 58 | * Decode JSON string |
@@ -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 | |
@@ -56,8 +56,7 @@ discard block |
||
| 56 | 56 | * Class AbstractConfiguration |
| 57 | 57 | * @package Platine\Stdlib\Config |
| 58 | 58 | */ |
| 59 | -abstract class AbstractConfiguration implements ConfigurationInterface |
|
| 60 | -{ |
|
| 59 | +abstract class AbstractConfiguration implements ConfigurationInterface { |
|
| 61 | 60 | |
| 62 | 61 | /** |
| 63 | 62 | * The raw configuration array |
@@ -68,8 +67,7 @@ discard block |
||
| 68 | 67 | /** |
| 69 | 68 | * {@inheritedoc} |
| 70 | 69 | */ |
| 71 | - public function __construct(array $config = []) |
|
| 72 | - { |
|
| 70 | + public function __construct(array $config = []) { |
|
| 73 | 71 | $configuration = array_merge($this->getDefault(), $config); |
| 74 | 72 | $this->load($configuration); |
| 75 | 73 | } |
@@ -77,8 +75,7 @@ discard block |
||
| 77 | 75 | /** |
| 78 | 76 | * {@inheritedoc} |
| 79 | 77 | */ |
| 80 | - public function get(string $name) |
|
| 81 | - { |
|
| 78 | + public function get(string $name) { |
|
| 82 | 79 | if (!$this->has($name)) { |
| 83 | 80 | throw new InvalidArgumentException(sprintf( |
| 84 | 81 | 'Configuration [%s] does not exist', |