Completed
Push — master ( 3fb8e6...24f92d )
by Lars
15:56
created
src/Arrayy.php 3 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -609,8 +609,8 @@  discard block
 block discarded – undo
609 609
   }
610 610
 
611 611
   /**
612
-   * @param mixed      $path
613
-   * @param \callable  $callable
612
+   * @param string      $path
613
+   * @param \Closure  $callable
614 614
    * @param null|array $currentOffset
615 615
    */
616 616
   protected function callAtPath($path, $callable, &$currentOffset = null)
@@ -1763,7 +1763,7 @@  discard block
 block discarded – undo
1763 1763
   }
1764 1764
 
1765 1765
   /**
1766
-   * @param mixed               $glue
1766
+   * @param string               $glue
1767 1767
    * @param string|array|static $pieces
1768 1768
    * @param bool                $useKeys
1769 1769
    *
@@ -3639,7 +3639,7 @@  discard block
 block discarded – undo
3639 3639
   /**
3640 3640
    * Apply the given function to every element in the array, discarding the results.
3641 3641
    *
3642
-   * @param \callable $callable
3642
+   * @param \Closure $callable
3643 3643
    * @param bool      $recursive <p>Whether array will be walked recursively or no</p>
3644 3644
    *
3645 3645
    * @return static <p>(Mutable) Return this Arrayy object, with modified elements.</p>
Please login to merge, or discard this patch.
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -960,25 +960,25 @@  discard block
 block discarded – undo
960 960
   {
961 961
     if ($recursive === true) {
962 962
       return \count(
963
-               \array_intersect($needles, $this->keys(true)->getArray()),
964
-               COUNT_RECURSIVE
965
-             )
966
-             ===
967
-             \count(
968
-               $needles,
969
-               COUNT_RECURSIVE
970
-             );
963
+                \array_intersect($needles, $this->keys(true)->getArray()),
964
+                COUNT_RECURSIVE
965
+              )
966
+              ===
967
+              \count(
968
+                $needles,
969
+                COUNT_RECURSIVE
970
+              );
971 971
     }
972 972
 
973 973
     return \count(
974
-             \array_intersect($needles, $this->keys()->getArray()),
975
-             COUNT_NORMAL
976
-           )
977
-           ===
978
-           \count(
979
-             $needles,
980
-             COUNT_NORMAL
981
-           );
974
+              \array_intersect($needles, $this->keys()->getArray()),
975
+              COUNT_NORMAL
976
+            )
977
+            ===
978
+            \count(
979
+              $needles,
980
+              COUNT_NORMAL
981
+            );
982 982
   }
983 983
 
984 984
   /**
@@ -1031,8 +1031,8 @@  discard block
 block discarded – undo
1031 1031
   public function containsValues(array $needles): bool
1032 1032
   {
1033 1033
     return \count(\array_intersect($needles, $this->array), COUNT_NORMAL)
1034
-           ===
1035
-           \count($needles, COUNT_NORMAL);
1034
+            ===
1035
+            \count($needles, COUNT_NORMAL);
1036 1036
   }
1037 1037
 
1038 1038
   /**
@@ -2379,15 +2379,15 @@  discard block
 block discarded – undo
2379 2379
 
2380 2380
     if ($recursive === true) {
2381 2381
       return $this->array_keys_recursive($this->array)
2382
-             ===
2383
-             \range(0, \count($this->array, COUNT_RECURSIVE) - 1);
2382
+              ===
2383
+              \range(0, \count($this->array, COUNT_RECURSIVE) - 1);
2384 2384
     }
2385 2385
 
2386 2386
     // non recursive
2387 2387
 
2388 2388
     return \array_keys($this->array)
2389
-           ===
2390
-           \range(0, \count($this->array, COUNT_NORMAL) - 1);
2389
+            ===
2390
+            \range(0, \count($this->array, COUNT_NORMAL) - 1);
2391 2391
   }
2392 2392
 
2393 2393
   /**
Please login to merge, or discard this patch.
Spacing   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
       &&
89 89
       \count(\array_diff_key($this->properties, $array)) > 0
90 90
     ) {
91
-      throw new \InvalidArgumentException('Property mismatch - input: ' . print_r(array_keys($array), true) . ' | expected: ' . print_r(array_keys($this->properties), true));
91
+      throw new \InvalidArgumentException('Property mismatch - input: '.print_r(array_keys($array), true).' | expected: '.print_r(array_keys($this->properties), true));
92 92
     }
93 93
 
94 94
     foreach ($array as $key => $value) {
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
       return $this->array[$key] ?? false;
130 130
     }
131 131
 
132
-    return (array)$this->array;
132
+    return (array) $this->array;
133 133
   }
134 134
 
135 135
   /**
@@ -373,8 +373,8 @@  discard block
 block discarded – undo
373 373
     }
374 374
 
375 375
     // php cast "bool"-index into "int"-index
376
-    if ((bool)$offset === $offset) {
377
-      $offset = (int)$offset;
376
+    if ((bool) $offset === $offset) {
377
+      $offset = (int) $offset;
378 378
     }
379 379
 
380 380
     $tmpReturn = \array_key_exists($offset, $this->array);
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
       (
386 386
         $tmpReturn === false
387 387
         &&
388
-        \strpos((string)$offset, $this->pathSeparator) === false
388
+        \strpos((string) $offset, $this->pathSeparator) === false
389 389
       )
390 390
     ) {
391 391
       return $tmpReturn;
@@ -393,16 +393,16 @@  discard block
 block discarded – undo
393 393
 
394 394
     $offsetExists = false;
395 395
 
396
-    if (\strpos((string)$offset, $this->pathSeparator) !== false) {
396
+    if (\strpos((string) $offset, $this->pathSeparator) !== false) {
397 397
 
398 398
       $offsetExists = false;
399
-      $explodedPath = \explode($this->pathSeparator, (string)$offset);
399
+      $explodedPath = \explode($this->pathSeparator, (string) $offset);
400 400
       $lastOffset = \array_pop($explodedPath);
401 401
       $containerPath = \implode($this->pathSeparator, $explodedPath);
402 402
 
403 403
       $this->callAtPath(
404 404
         $containerPath,
405
-        function ($container) use ($lastOffset, &$offsetExists) {
405
+        function($container) use ($lastOffset, &$offsetExists) {
406 406
           $offsetExists = \array_key_exists($lastOffset, $container);
407 407
         }
408 408
       );
@@ -455,14 +455,14 @@  discard block
 block discarded – undo
455 455
       return;
456 456
     }
457 457
 
458
-    if (\strpos((string)$offset, $this->pathSeparator) !== false) {
458
+    if (\strpos((string) $offset, $this->pathSeparator) !== false) {
459 459
 
460
-      $path = \explode($this->pathSeparator, (string)$offset);
460
+      $path = \explode($this->pathSeparator, (string) $offset);
461 461
       $pathToUnset = \array_pop($path);
462 462
 
463 463
       $this->callAtPath(
464 464
         \implode($this->pathSeparator, $path),
465
-        function (&$offset) use ($pathToUnset) {
465
+        function(&$offset) use ($pathToUnset) {
466 466
           unset($offset[$pathToUnset]);
467 467
         }
468 468
       );
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
     }
500 500
 
501 501
     if (\strpos($class, '\\') === 0) {
502
-      $class = '\\' . $class;
502
+      $class = '\\'.$class;
503 503
       if (\class_exists($class)) {
504 504
         $this->iteratorClass = $class;
505 505
 
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
       }
508 508
     }
509 509
 
510
-    throw new \InvalidArgumentException('The iterator class does not exist: ' . $class);
510
+    throw new \InvalidArgumentException('The iterator class does not exist: '.$class);
511 511
   }
512 512
 
513 513
   /**
@@ -607,13 +607,13 @@  discard block
 block discarded – undo
607 607
 
608 608
     foreach ($this->getGenerator() as $key => $item) {
609 609
       if ($item instanceof self) {
610
-        $result[$prefix . $key] = $item->appendToEachKey($prefix);
610
+        $result[$prefix.$key] = $item->appendToEachKey($prefix);
611 611
       } elseif (\is_array($item)) {
612
-        $result[$prefix . $key] = self::create($item, $this->iteratorClass, false)
612
+        $result[$prefix.$key] = self::create($item, $this->iteratorClass, false)
613 613
                                       ->appendToEachKey($prefix)
614 614
                                       ->toArray();
615 615
       } else {
616
-        $result[$prefix . $key] = $item;
616
+        $result[$prefix.$key] = $item;
617 617
       }
618 618
     }
619 619
 
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
       } elseif (\is_object($item)) {
641 641
         $result[$key] = $item;
642 642
       } else {
643
-        $result[$key] = $prefix . $item;
643
+        $result[$key] = $prefix.$item;
644 644
       }
645 645
     }
646 646
 
@@ -865,8 +865,8 @@  discard block
 block discarded – undo
865 865
   public function clean()
866 866
   {
867 867
     return $this->filter(
868
-      function ($value) {
869
-        return (bool)$value;
868
+      function($value) {
869
+        return (bool) $value;
870 870
       }
871 871
     );
872 872
   }
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
       return $this->in_array_recursive(
916 916
         UTF8::strtoupper($value),
917 917
         $this->walk(
918
-          function (&$val) {
918
+          function(&$val) {
919 919
             $val = UTF8::strtoupper($val);
920 920
           },
921 921
           true
@@ -927,7 +927,7 @@  discard block
 block discarded – undo
927 927
     return \in_array(
928 928
       UTF8::strtoupper($value),
929 929
       $this->walk(
930
-        function (&$val) {
930
+        function(&$val) {
931 931
           $val = UTF8::strtoupper($val);
932 932
         },
933 933
         false
@@ -1175,7 +1175,7 @@  discard block
 block discarded – undo
1175 1175
     // trim all string in the array
1176 1176
     \array_walk(
1177 1177
       $array,
1178
-      function (&$val) {
1178
+      function(&$val) {
1179 1179
         /** @noinspection ReferenceMismatchInspection */
1180 1180
         if (\is_string($val)) {
1181 1181
           $val = \trim($val);
@@ -1420,7 +1420,7 @@  discard block
 block discarded – undo
1420 1420
     }
1421 1421
 
1422 1422
     if ($isObject && \method_exists($array, '__toArray')) {
1423
-      return (array)$array->__toArray();
1423
+      return (array) $array->__toArray();
1424 1424
     }
1425 1425
 
1426 1426
     /** @noinspection ReferenceMismatchInspection */
@@ -1429,7 +1429,7 @@  discard block
 block discarded – undo
1429 1429
       ||
1430 1430
       ($isObject && \method_exists($array, '__toString'))
1431 1431
     ) {
1432
-      return [(string)$array];
1432
+      return [(string) $array];
1433 1433
     }
1434 1434
 
1435 1435
     throw new \InvalidArgumentException(
@@ -1533,54 +1533,54 @@  discard block
 block discarded – undo
1533 1533
     }
1534 1534
 
1535 1535
     $ops = [
1536
-      'eq'          => function ($item, $prop, $value) {
1536
+      'eq'          => function($item, $prop, $value) {
1537 1537
         return $item[$prop] === $value;
1538 1538
       },
1539
-      'gt'          => function ($item, $prop, $value) {
1539
+      'gt'          => function($item, $prop, $value) {
1540 1540
         return $item[$prop] > $value;
1541 1541
       },
1542
-      'ge'          => function ($item, $prop, $value) {
1542
+      'ge'          => function($item, $prop, $value) {
1543 1543
         return $item[$prop] >= $value;
1544 1544
       },
1545
-      'gte'         => function ($item, $prop, $value) {
1545
+      'gte'         => function($item, $prop, $value) {
1546 1546
         return $item[$prop] >= $value;
1547 1547
       },
1548
-      'lt'          => function ($item, $prop, $value) {
1548
+      'lt'          => function($item, $prop, $value) {
1549 1549
         return $item[$prop] < $value;
1550 1550
       },
1551
-      'le'          => function ($item, $prop, $value) {
1551
+      'le'          => function($item, $prop, $value) {
1552 1552
         return $item[$prop] <= $value;
1553 1553
       },
1554
-      'lte'         => function ($item, $prop, $value) {
1554
+      'lte'         => function($item, $prop, $value) {
1555 1555
         return $item[$prop] <= $value;
1556 1556
       },
1557
-      'ne'          => function ($item, $prop, $value) {
1557
+      'ne'          => function($item, $prop, $value) {
1558 1558
         return $item[$prop] !== $value;
1559 1559
       },
1560
-      'contains'    => function ($item, $prop, $value) {
1561
-        return \in_array($item[$prop], (array)$value, true);
1560
+      'contains'    => function($item, $prop, $value) {
1561
+        return \in_array($item[$prop], (array) $value, true);
1562 1562
       },
1563
-      'notContains' => function ($item, $prop, $value) {
1564
-        return !\in_array($item[$prop], (array)$value, true);
1563
+      'notContains' => function($item, $prop, $value) {
1564
+        return !\in_array($item[$prop], (array) $value, true);
1565 1565
       },
1566
-      'newer'       => function ($item, $prop, $value) {
1566
+      'newer'       => function($item, $prop, $value) {
1567 1567
         return \strtotime($item[$prop]) > \strtotime($value);
1568 1568
       },
1569
-      'older'       => function ($item, $prop, $value) {
1569
+      'older'       => function($item, $prop, $value) {
1570 1570
         return \strtotime($item[$prop]) < \strtotime($value);
1571 1571
       },
1572 1572
     ];
1573 1573
 
1574 1574
     $result = \array_values(
1575 1575
       \array_filter(
1576
-        (array)$this->array,
1577
-        function ($item) use (
1576
+        (array) $this->array,
1577
+        function($item) use (
1578 1578
           $property,
1579 1579
           $value,
1580 1580
           $ops,
1581 1581
           $comparisonOp
1582 1582
         ) {
1583
-          $item = (array)$item;
1583
+          $item = (array) $item;
1584 1584
           $itemArrayy = new Arrayy($item);
1585 1585
           $item[$property] = $itemArrayy->get($property, []);
1586 1586
 
@@ -1649,9 +1649,9 @@  discard block
 block discarded – undo
1649 1649
   {
1650 1650
     if ($number === null) {
1651 1651
       $arrayTmp = $this->array;
1652
-      $array = (array)\array_shift($arrayTmp);
1652
+      $array = (array) \array_shift($arrayTmp);
1653 1653
     } else {
1654
-      $number = (int)$number;
1654
+      $number = (int) $number;
1655 1655
       $arrayTmp = $this->array;
1656 1656
       $array = \array_splice($arrayTmp, 0, $number, true);
1657 1657
     }
@@ -1669,9 +1669,9 @@  discard block
 block discarded – undo
1669 1669
   public function firstsMutable(int $number = null)
1670 1670
   {
1671 1671
     if ($number === null) {
1672
-      $this->array = (array)\array_shift($this->array);
1672
+      $this->array = (array) \array_shift($this->array);
1673 1673
     } else {
1674
-      $number = (int)$number;
1674
+      $number = (int) $number;
1675 1675
       $this->array = \array_splice($this->array, 0, $number, true);
1676 1676
     }
1677 1677
 
@@ -1715,8 +1715,8 @@  discard block
 block discarded – undo
1715 1715
     }
1716 1716
 
1717 1717
     // php cast "bool"-index into "int"-index
1718
-    if ((bool)$key === $key) {
1719
-      $key = (int)$key;
1718
+    if ((bool) $key === $key) {
1719
+      $key = (int) $key;
1720 1720
     }
1721 1721
 
1722 1722
     if (\array_key_exists($key, $usedArray) === true) {
@@ -1728,7 +1728,7 @@  discard block
 block discarded – undo
1728 1728
     }
1729 1729
 
1730 1730
     // Crawl through array, get key according to object or not
1731
-    foreach (\explode($this->pathSeparator, (string)$key) as $segment) {
1731
+    foreach (\explode($this->pathSeparator, (string) $key) as $segment) {
1732 1732
       if (!isset($usedArray[$segment])) {
1733 1733
         return $fallback instanceof \Closure ? $fallback() : $fallback;
1734 1734
       }
@@ -1842,7 +1842,7 @@  discard block
 block discarded – undo
1842 1842
   protected function getPublicProperties(): array
1843 1843
   {
1844 1844
     static $PROPERTY_CACHE = [];
1845
-    $cacheKey = 'Class::' . static::class;
1845
+    $cacheKey = 'Class::'.static::class;
1846 1846
 
1847 1847
     if (isset($PROPERTY_CACHE[$cacheKey])) {
1848 1848
       return $PROPERTY_CACHE[$cacheKey];
@@ -2039,7 +2039,7 @@  discard block
 block discarded – undo
2039 2039
       );
2040 2040
     }
2041 2041
 
2042
-    return (string)$pieces;
2042
+    return (string) $pieces;
2043 2043
   }
2044 2044
 
2045 2045
   /**
@@ -2173,7 +2173,7 @@  discard block
 block discarded – undo
2173 2173
    */
2174 2174
   protected function internalRemove($key): bool
2175 2175
   {
2176
-    $path = \explode($this->pathSeparator, (string)$key);
2176
+    $path = \explode($this->pathSeparator, (string) $key);
2177 2177
 
2178 2178
     // Crawl though the keys
2179 2179
     while (\count($path, COUNT_NORMAL) > 1) {
@@ -2205,7 +2205,7 @@  discard block
 block discarded – undo
2205 2205
   {
2206 2206
     if ($this->checkPropertyTypes === true) {
2207 2207
       if (isset($this->properties[$key]) === false) {
2208
-        throw new \InvalidArgumentException('The key ' . $key . ' does not exists as @property in the class (' . \get_class($this) . ').');
2208
+        throw new \InvalidArgumentException('The key '.$key.' does not exists as @property in the class ('.\get_class($this).').');
2209 2209
       }
2210 2210
 
2211 2211
       $this->properties[$key]->checkType($value);
@@ -2216,14 +2216,14 @@  discard block
 block discarded – undo
2216 2216
     }
2217 2217
 
2218 2218
     // init
2219
-    $array =& $this->array;
2220
-    $path = \explode($this->pathSeparator, (string)$key);
2219
+    $array = & $this->array;
2220
+    $path = \explode($this->pathSeparator, (string) $key);
2221 2221
 
2222 2222
     // Crawl through the keys
2223 2223
     while (\count($path, COUNT_NORMAL) > 1) {
2224 2224
       $key = \array_shift($path);
2225 2225
 
2226
-      $array =& $array[$key];
2226
+      $array = & $array[$key];
2227 2227
     }
2228 2228
 
2229 2229
     $array[\array_shift($path)] = $value;
@@ -2486,12 +2486,12 @@  discard block
 block discarded – undo
2486 2486
       if ($poppedValue === null) {
2487 2487
         $poppedValue = [$poppedValue];
2488 2488
       } else {
2489
-        $poppedValue = (array)$poppedValue;
2489
+        $poppedValue = (array) $poppedValue;
2490 2490
       }
2491 2491
 
2492 2492
       $arrayy = static::create($poppedValue, $this->iteratorClass, false);
2493 2493
     } else {
2494
-      $number = (int)$number;
2494
+      $number = (int) $number;
2495 2495
       $arrayy = $this->rest(-$number);
2496 2496
     }
2497 2497
 
@@ -2517,12 +2517,12 @@  discard block
 block discarded – undo
2517 2517
       if ($poppedValue === null) {
2518 2518
         $poppedValue = [$poppedValue];
2519 2519
       } else {
2520
-        $poppedValue = (array)$poppedValue;
2520
+        $poppedValue = (array) $poppedValue;
2521 2521
       }
2522 2522
 
2523 2523
       $this->array = static::create($poppedValue, $this->iteratorClass, false)->array;
2524 2524
     } else {
2525
-      $number = (int)$number;
2525
+      $number = (int) $number;
2526 2526
       $this->array = $this->rest(-$number)->array;
2527 2527
     }
2528 2528
 
@@ -2873,7 +2873,7 @@  discard block
 block discarded – undo
2873 2873
       } elseif (\is_array($item)) {
2874 2874
         $result[$key] = self::create($item, $this->iteratorClass, false)->prependToEachKey($suffix)->toArray();
2875 2875
       } else {
2876
-        $result[$key . $suffix] = $item;
2876
+        $result[$key.$suffix] = $item;
2877 2877
       }
2878 2878
 
2879 2879
     }
@@ -2903,7 +2903,7 @@  discard block
 block discarded – undo
2903 2903
       } elseif (\is_object($item)) {
2904 2904
         $result[$key] = $item;
2905 2905
       } else {
2906
-        $result[$key] = $item . $suffix;
2906
+        $result[$key] = $item.$suffix;
2907 2907
       }
2908 2908
     }
2909 2909
 
@@ -2993,7 +2993,7 @@  discard block
 block discarded – undo
2993 2993
       );
2994 2994
     }
2995 2995
 
2996
-    $result = (array)\array_rand($this->array, $number);
2996
+    $result = (array) \array_rand($this->array, $number);
2997 2997
 
2998 2998
     return static::create($result, $this->iteratorClass, false);
2999 2999
   }
@@ -3094,7 +3094,7 @@  discard block
 block discarded – undo
3094 3094
     if ($result === null) {
3095 3095
       $this->array = [];
3096 3096
     } else {
3097
-      $this->array = (array)$result;
3097
+      $this->array = (array) $result;
3098 3098
     }
3099 3099
 
3100 3100
     return static::create($this->array, $this->iteratorClass, false);
@@ -3221,7 +3221,7 @@  discard block
 block discarded – undo
3221 3221
     }
3222 3222
 
3223 3223
     return static::create(
3224
-      \array_fill(0, (int)$times, $this->array),
3224
+      \array_fill(0, (int) $times, $this->array),
3225 3225
       $this->iteratorClass,
3226 3226
       false
3227 3227
     );
@@ -3321,7 +3321,7 @@  discard block
 block discarded – undo
3321 3321
   public function replaceValues($search, $replacement = '')
3322 3322
   {
3323 3323
     $array = $this->each(
3324
-      function ($value) use ($search, $replacement) {
3324
+      function($value) use ($search, $replacement) {
3325 3325
         return UTF8::str_replace($search, $replacement, $value);
3326 3326
       }
3327 3327
     );
@@ -3406,8 +3406,8 @@  discard block
 block discarded – undo
3406 3406
     }
3407 3407
 
3408 3408
     // php cast "bool"-index into "int"-index
3409
-    if ((bool)$index === $index) {
3410
-      $index = (int)$index;
3409
+    if ((bool) $index === $index) {
3410
+      $index = (int) $index;
3411 3411
     }
3412 3412
 
3413 3413
     if (\array_key_exists($index, $this->array) === true) {
@@ -3650,7 +3650,7 @@  discard block
 block discarded – undo
3650 3650
    */
3651 3651
   public function sorter($sorter = null, $direction = SORT_ASC, int $strategy = SORT_REGULAR)
3652 3652
   {
3653
-    $array = (array)$this->array;
3653
+    $array = (array) $this->array;
3654 3654
     $direction = $this->getDirection($direction);
3655 3655
 
3656 3656
     // Transform all values into their results.
@@ -3659,7 +3659,7 @@  discard block
 block discarded – undo
3659 3659
 
3660 3660
       $that = $this;
3661 3661
       $results = $arrayy->each(
3662
-        function ($value) use ($sorter, $that) {
3662
+        function($value) use ($sorter, $that) {
3663 3663
           return \is_callable($sorter) ? $sorter($value) : $that->get($sorter, null, $value);
3664 3664
         }
3665 3665
       );
@@ -3757,7 +3757,7 @@  discard block
 block discarded – undo
3757 3757
     if ($arrayCount === 0) {
3758 3758
       $result = [];
3759 3759
     } else {
3760
-      $splitSize = (int)\ceil($arrayCount / $numberOfPieces);
3760
+      $splitSize = (int) \ceil($arrayCount / $numberOfPieces);
3761 3761
       $result = \array_chunk($this->array, $splitSize, $keepKeys);
3762 3762
     }
3763 3763
 
@@ -3772,12 +3772,12 @@  discard block
 block discarded – undo
3772 3772
   public function stripEmpty()
3773 3773
   {
3774 3774
     return $this->filter(
3775
-      function ($item) {
3775
+      function($item) {
3776 3776
         if ($item === null) {
3777 3777
           return false;
3778 3778
         }
3779 3779
 
3780
-        return (bool)\trim((string)$item);
3780
+        return (bool) \trim((string) $item);
3781 3781
       }
3782 3782
     );
3783 3783
   }
@@ -3845,7 +3845,7 @@  discard block
 block discarded – undo
3845 3845
 
3846 3846
     $this->array = \array_reduce(
3847 3847
       $this->array,
3848
-      function ($resultArray, $value) {
3848
+      function($resultArray, $value) {
3849 3849
         if (!\in_array($value, $resultArray, true)) {
3850 3850
           $resultArray[] = $value;
3851 3851
         }
@@ -3858,7 +3858,7 @@  discard block
 block discarded – undo
3858 3858
     if ($this->array === null) {
3859 3859
       $this->array = [];
3860 3860
     } else {
3861
-      $this->array = (array)$this->array;
3861
+      $this->array = (array) $this->array;
3862 3862
     }
3863 3863
 
3864 3864
     return $this;
@@ -3878,7 +3878,7 @@  discard block
 block discarded – undo
3878 3878
 
3879 3879
     $this->array = \array_reduce(
3880 3880
       \array_keys($array),
3881
-      function ($resultArray, $key) use ($array) {
3881
+      function($resultArray, $key) use ($array) {
3882 3882
         if (!\in_array($array[$key], $resultArray, true)) {
3883 3883
           $resultArray[$key] = $array[$key];
3884 3884
         }
@@ -3891,7 +3891,7 @@  discard block
 block discarded – undo
3891 3891
     if ($this->array === null) {
3892 3892
       $this->array = [];
3893 3893
     } else {
3894
-      $this->array = (array)$this->array;
3894
+      $this->array = (array) $this->array;
3895 3895
     }
3896 3896
 
3897 3897
     return $this;
@@ -3932,7 +3932,7 @@  discard block
 block discarded – undo
3932 3932
   public function values()
3933 3933
   {
3934 3934
     return static::create(
3935
-      \array_values((array)$this->array),
3935
+      \array_values((array) $this->array),
3936 3936
       $this->iteratorClass,
3937 3937
       false
3938 3938
     );
Please login to merge, or discard this patch.
src/StaticArrayy.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     }
44 44
 
45 45
     if (!isset(static::$methodArgs[$name])) {
46
-      throw new \BadMethodCallException($name . ' is not a valid method');
46
+      throw new \BadMethodCallException($name.' is not a valid method');
47 47
     }
48 48
 
49 49
     $numArgs = \count($arguments);
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
    */
104 104
   public static function repeat($data, $times): Arrayy
105 105
   {
106
-    $times = (int)$times;
106
+    $times = (int) $times;
107 107
 
108 108
     if ($times === 0 || empty($data)) {
109 109
       return Arrayy::create();
Please login to merge, or discard this patch.
src/Property.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
   protected static function parseDocTypeObject(Type $type)
162 162
   {
163 163
     if ($type instanceof \phpDocumentor\Reflection\Types\Object_) {
164
-      return (string)$type->getFqsen();
164
+      return (string) $type->getFqsen();
165 165
     }
166 166
 
167 167
     if ($type instanceof \phpDocumentor\Reflection\Types\Array_) {
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
       return 'int';
215 215
     }
216 216
 
217
-    throw new \Exception('Unhandled PhpDoc type: ' . get_class($type));
217
+    throw new \Exception('Unhandled PhpDoc type: '.get_class($type));
218 218
   }
219 219
 
220 220
   /**
Please login to merge, or discard this patch.