Passed
Push — develop ( c09191...4b5082 )
by nguereza
02:18
created
src/Helper/Php.php 1 patch
Braces   +5 added lines, -7 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@  discard block
 block discarded – undo
52 52
  * Class Php
53 53
  * @package Platine\Stdlib\Helper
54 54
  */
55
-class Php
56
-{
55
+class Php {
57 56
 
58 57
     /**
59 58
      * Call by callback
@@ -62,13 +61,13 @@  discard block
 block discarded – undo
62 61
      *
63 62
      * @return mixed
64 63
      */
65
-    public static function call($callback, ...$args)
66
-    {
64
+    public static function call($callback, ...$args) {
67 65
         if (is_string($callback)) {
68 66
             // className::method
69 67
             if (strpos($callback, '::') > 0) {
70 68
                 $callback = explode('::', $callback, 2);
71
-            } elseif (function_exists($callback)) { //function
69
+            } elseif (function_exists($callback)) {
70
+//function
72 71
                 return $callback(...$args);
73 72
             }
74 73
         } elseif (is_object($callback) && method_exists($callback, '__invoke')) {
@@ -93,8 +92,7 @@  discard block
 block discarded – undo
93 92
      *
94 93
      * @return mixed
95 94
      */
96
-    public static function callArray($callback, array $args)
97
-    {
95
+    public static function callArray($callback, array $args) {
98 96
         return self::call($callback, ...$args);
99 97
     }
100 98
 
Please login to merge, or discard this patch.
src/Helper/Json.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Helper/Arr.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
                 $result = $object->toArray();
108 108
             } else {
109 109
                 $result = [];
110
-                foreach ((array)$object as $key => $value) {
110
+                foreach ((array) $object as $key => $value) {
111 111
                     $result[$key] = $value;
112 112
                 }
113 113
             }
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
      */
128 128
     public static function merge(array ...$args): array
129 129
     {
130
-        $res = (array)array_shift($args);
130
+        $res = (array) array_shift($args);
131 131
         while (!empty($args)) {
132 132
             $next = array_shift($args);
133 133
             foreach ($next as $key => $value) {
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
             return;
468 468
         }
469 469
 
470
-        $count  = count($keys);
470
+        $count = count($keys);
471 471
         if (is_scalar($direction)) {
472 472
             $direction = array_fill(0, $count, $direction);
473 473
         } elseif (count($direction) !== $count) {
@@ -929,7 +929,7 @@  discard block
 block discarded – undo
929 929
         $max = 0;
930 930
         foreach ($array as $key => $value) {
931 931
             if (!$expectInt || !is_numeric($key)) {
932
-                $width = mb_strlen((string)$key, 'UTF-8');
932
+                $width = mb_strlen((string) $key, 'UTF-8');
933 933
                 if ($width > $max) {
934 934
                     $max = $width;
935 935
                 }
@@ -1049,7 +1049,7 @@  discard block
 block discarded – undo
1049 1049
             } else {
1050 1050
                 $itemKey = static::get($item, $key);
1051 1051
                 if (is_object($itemKey) && method_exists($itemKey, '__toString')) {
1052
-                    $itemKey = (string)$itemKey;
1052
+                    $itemKey = (string) $itemKey;
1053 1053
                 }
1054 1054
 
1055 1055
                 $results[$itemKey] = $itemValue;
@@ -1152,7 +1152,7 @@  discard block
 block discarded – undo
1152 1152
         $keys = array_rand($array, $number);
1153 1153
 
1154 1154
         $results = [];
1155
-        foreach ((array)$keys as $key) {
1155
+        foreach ((array) $keys as $key) {
1156 1156
             $results[] = $array[$key];
1157 1157
         }
1158 1158
 
@@ -1202,18 +1202,18 @@  discard block
 block discarded – undo
1202 1202
             if (preg_match('/^\-\w=/', $arg)) {
1203 1203
                 $normalized = array_merge(
1204 1204
                     $normalized,
1205
-                    (array)explode('=', $arg)
1205
+                    (array) explode('=', $arg)
1206 1206
                 );
1207 1207
             } elseif (preg_match('/^\-\w{2,}/', $arg)) {
1208 1208
                 $splitArgs = implode(' -', str_split(ltrim($arg, '-')));
1209 1209
                 $normalized = array_merge(
1210 1210
                     $normalized,
1211
-                    (array)explode(' ', '-' . $splitArgs)
1211
+                    (array) explode(' ', '-' . $splitArgs)
1212 1212
                 );
1213 1213
             } elseif (preg_match('/^\-\-([^\s\=]+)\=/', $arg)) {
1214 1214
                 $normalized = array_merge(
1215 1215
                     $normalized,
1216
-                    (array)explode('=', $arg)
1216
+                    (array) explode('=', $arg)
1217 1217
                 );
1218 1218
             } else {
1219 1219
                 $normalized[] = $arg;
Please login to merge, or discard this patch.
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -57,8 +57,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
220 218
      *
221 219
      * @return mixed|null
222 220
      */
223
-    public static function remove(array &$array, string $key, $default = null)
224
-    {
221
+    public static function remove(array &$array, string $key, $default = null) {
225 222
         if (isset($array[$key]) || array_key_exists($key, $array)) {
226 223
             $value = $array[$key];
227 224
 
@@ -294,8 +291,7 @@  discard block
 block discarded – undo
294 291
      * @param mixed $default
295 292
      * @return mixed
296 293
      */
297
-    public static function pull(array &$array, string $key, $default = null)
298
-    {
294
+    public static function pull(array &$array, string $key, $default = null) {
299 295
         $value = static::get($array, $key, $default);
300 296
 
301 297
         static::forget($array, $key);
@@ -752,8 +748,7 @@  discard block
 block discarded – undo
752 748
      * @param mixed $default
753 749
      * @return mixed
754 750
      */
755
-    public static function get($array, ?string $key = null, $default = null)
756
-    {
751
+    public static function get($array, ?string $key = null, $default = null) {
757 752
         if ($key === null) {
758 753
             return $array;
759 754
         }
@@ -1128,8 +1123,7 @@  discard block
 block discarded – undo
1128 1123
      *
1129 1124
      * @return mixed
1130 1125
      */
1131
-    public static function random(array $array, ?int $number = null)
1132
-    {
1126
+    public static function random(array $array, ?int $number = null) {
1133 1127
         $requested = $number === null ? 1 : $number;
1134 1128
         $count = count($array);
1135 1129
 
Please login to merge, or discard this patch.