@@ -772,8 +772,8 @@ discard block |
||
772 | 772 | } |
773 | 773 | |
774 | 774 | /** |
775 | - * @param mixed $path |
|
776 | - * @param \callable $callable |
|
775 | + * @param string $path |
|
776 | + * @param \Closure $callable |
|
777 | 777 | * @param array|null $currentOffset |
778 | 778 | */ |
779 | 779 | protected function callAtPath($path, $callable, &$currentOffset = null) |
@@ -2038,7 +2038,7 @@ discard block |
||
2038 | 2038 | } |
2039 | 2039 | |
2040 | 2040 | /** |
2041 | - * @param mixed $glue |
|
2041 | + * @param string $glue |
|
2042 | 2042 | * @param array|static|string $pieces |
2043 | 2043 | * @param bool $useKeys |
2044 | 2044 | * |
@@ -3962,7 +3962,7 @@ discard block |
||
3962 | 3962 | /** |
3963 | 3963 | * Apply the given function to every element in the array, discarding the results. |
3964 | 3964 | * |
3965 | - * @param \callable $callable |
|
3965 | + * @param \Closure $callable |
|
3966 | 3966 | * @param bool $recursive <p>Whether array will be walked recursively or no</p> |
3967 | 3967 | * |
3968 | 3968 | * @return static <p>(Mutable) Return this Arrayy object, with modified elements.</p> |
@@ -978,25 +978,25 @@ discard block |
||
978 | 978 | { |
979 | 979 | if ($recursive === true) { |
980 | 980 | return \count( |
981 | - \array_intersect($needles, $this->keys(true)->getArray()), |
|
982 | - \COUNT_RECURSIVE |
|
983 | - ) |
|
984 | - === |
|
985 | - \count( |
|
986 | - $needles, |
|
987 | - \COUNT_RECURSIVE |
|
988 | - ); |
|
981 | + \array_intersect($needles, $this->keys(true)->getArray()), |
|
982 | + \COUNT_RECURSIVE |
|
983 | + ) |
|
984 | + === |
|
985 | + \count( |
|
986 | + $needles, |
|
987 | + \COUNT_RECURSIVE |
|
988 | + ); |
|
989 | 989 | } |
990 | 990 | |
991 | 991 | return \count( |
992 | - \array_intersect($needles, $this->keys()->getArray()), |
|
993 | - \COUNT_NORMAL |
|
994 | - ) |
|
995 | - === |
|
996 | - \count( |
|
997 | - $needles, |
|
998 | - \COUNT_NORMAL |
|
999 | - ); |
|
992 | + \array_intersect($needles, $this->keys()->getArray()), |
|
993 | + \COUNT_NORMAL |
|
994 | + ) |
|
995 | + === |
|
996 | + \count( |
|
997 | + $needles, |
|
998 | + \COUNT_NORMAL |
|
999 | + ); |
|
1000 | 1000 | } |
1001 | 1001 | |
1002 | 1002 | /** |
@@ -1049,8 +1049,8 @@ discard block |
||
1049 | 1049 | public function containsValues(array $needles): bool |
1050 | 1050 | { |
1051 | 1051 | return \count(\array_intersect($needles, $this->array), \COUNT_NORMAL) |
1052 | - === |
|
1053 | - \count($needles, \COUNT_NORMAL); |
|
1052 | + === |
|
1053 | + \count($needles, \COUNT_NORMAL); |
|
1054 | 1054 | } |
1055 | 1055 | |
1056 | 1056 | /** |
@@ -2400,15 +2400,15 @@ discard block |
||
2400 | 2400 | |
2401 | 2401 | if ($recursive === true) { |
2402 | 2402 | return $this->array_keys_recursive($this->array) |
2403 | - === |
|
2404 | - \range(0, \count($this->array, \COUNT_RECURSIVE) - 1); |
|
2403 | + === |
|
2404 | + \range(0, \count($this->array, \COUNT_RECURSIVE) - 1); |
|
2405 | 2405 | } |
2406 | 2406 | |
2407 | 2407 | // non recursive |
2408 | 2408 | |
2409 | 2409 | return \array_keys($this->array) |
2410 | - === |
|
2411 | - \range(0, \count($this->array, \COUNT_NORMAL) - 1); |
|
2410 | + === |
|
2411 | + \range(0, \count($this->array, \COUNT_NORMAL) - 1); |
|
2412 | 2412 | } |
2413 | 2413 | |
2414 | 2414 | /** |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | && |
88 | 88 | \count(\array_diff_key($this->properties, $array)) > 0 |
89 | 89 | ) { |
90 | - throw new \InvalidArgumentException('Property mismatch - input: ' . \print_r(\array_keys($array), true) . ' | expected: ' . \print_r(\array_keys($this->properties), true)); |
|
90 | + throw new \InvalidArgumentException('Property mismatch - input: '.\print_r(\array_keys($array), true).' | expected: '.\print_r(\array_keys($this->properties), true)); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | foreach ($array as $key => $value) { |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | |
400 | 400 | $this->callAtPath( |
401 | 401 | $containerPath, |
402 | - function ($container) use ($lastOffset, &$offsetExists) { |
|
402 | + function($container) use ($lastOffset, &$offsetExists) { |
|
403 | 403 | $offsetExists = \array_key_exists($lastOffset, $container); |
404 | 404 | } |
405 | 405 | ); |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | |
459 | 459 | $this->callAtPath( |
460 | 460 | \implode($this->pathSeparator, $path), |
461 | - function (&$offset) use ($pathToUnset) { |
|
461 | + function(&$offset) use ($pathToUnset) { |
|
462 | 462 | unset($offset[$pathToUnset]); |
463 | 463 | } |
464 | 464 | ); |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | } |
496 | 496 | |
497 | 497 | if (\strpos($class, '\\') === 0) { |
498 | - $class = '\\' . $class; |
|
498 | + $class = '\\'.$class; |
|
499 | 499 | if (\class_exists($class)) { |
500 | 500 | $this->iteratorClass = $class; |
501 | 501 | |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | } |
504 | 504 | } |
505 | 505 | |
506 | - throw new \InvalidArgumentException('The iterator class does not exist: ' . $class); |
|
506 | + throw new \InvalidArgumentException('The iterator class does not exist: '.$class); |
|
507 | 507 | } |
508 | 508 | |
509 | 509 | /** |
@@ -603,13 +603,13 @@ discard block |
||
603 | 603 | |
604 | 604 | foreach ($this->getGenerator() as $key => $item) { |
605 | 605 | if ($item instanceof self) { |
606 | - $result[$prefix . $key] = $item->appendToEachKey($prefix); |
|
606 | + $result[$prefix.$key] = $item->appendToEachKey($prefix); |
|
607 | 607 | } elseif (\is_array($item)) { |
608 | - $result[$prefix . $key] = self::create($item, $this->iteratorClass, false) |
|
608 | + $result[$prefix.$key] = self::create($item, $this->iteratorClass, false) |
|
609 | 609 | ->appendToEachKey($prefix) |
610 | 610 | ->toArray(); |
611 | 611 | } else { |
612 | - $result[$prefix . $key] = $item; |
|
612 | + $result[$prefix.$key] = $item; |
|
613 | 613 | } |
614 | 614 | } |
615 | 615 | |
@@ -636,7 +636,7 @@ discard block |
||
636 | 636 | } elseif (\is_object($item)) { |
637 | 637 | $result[$key] = $item; |
638 | 638 | } else { |
639 | - $result[$key] = $prefix . $item; |
|
639 | + $result[$key] = $prefix.$item; |
|
640 | 640 | } |
641 | 641 | } |
642 | 642 | |
@@ -879,7 +879,7 @@ discard block |
||
879 | 879 | public function clean() |
880 | 880 | { |
881 | 881 | return $this->filter( |
882 | - function ($value) { |
|
882 | + function($value) { |
|
883 | 883 | return (bool) $value; |
884 | 884 | } |
885 | 885 | ); |
@@ -930,7 +930,7 @@ discard block |
||
930 | 930 | return $this->in_array_recursive( |
931 | 931 | \mb_strtoupper((string) $value), |
932 | 932 | $this->walk( |
933 | - function (&$val) { |
|
933 | + function(&$val) { |
|
934 | 934 | /** @noinspection PhpComposerExtensionStubsInspection */ |
935 | 935 | $val = \mb_strtoupper((string) $val); |
936 | 936 | }, |
@@ -944,7 +944,7 @@ discard block |
||
944 | 944 | return \in_array( |
945 | 945 | \mb_strtoupper((string) $value), |
946 | 946 | $this->walk( |
947 | - function (&$val) { |
|
947 | + function(&$val) { |
|
948 | 948 | /** @noinspection PhpComposerExtensionStubsInspection */ |
949 | 949 | $val = \mb_strtoupper((string) $val); |
950 | 950 | }, |
@@ -1193,7 +1193,7 @@ discard block |
||
1193 | 1193 | // trim all string in the array |
1194 | 1194 | \array_walk( |
1195 | 1195 | $array, |
1196 | - function (&$val) { |
|
1196 | + function(&$val) { |
|
1197 | 1197 | /** @noinspection ReferenceMismatchInspection */ |
1198 | 1198 | if (\is_string($val)) { |
1199 | 1199 | $val = \trim($val); |
@@ -1550,40 +1550,40 @@ discard block |
||
1550 | 1550 | } |
1551 | 1551 | |
1552 | 1552 | $ops = [ |
1553 | - 'eq' => function ($item, $prop, $value) { |
|
1553 | + 'eq' => function($item, $prop, $value) { |
|
1554 | 1554 | return $item[$prop] === $value; |
1555 | 1555 | }, |
1556 | - 'gt' => function ($item, $prop, $value) { |
|
1556 | + 'gt' => function($item, $prop, $value) { |
|
1557 | 1557 | return $item[$prop] > $value; |
1558 | 1558 | }, |
1559 | - 'ge' => function ($item, $prop, $value) { |
|
1559 | + 'ge' => function($item, $prop, $value) { |
|
1560 | 1560 | return $item[$prop] >= $value; |
1561 | 1561 | }, |
1562 | - 'gte' => function ($item, $prop, $value) { |
|
1562 | + 'gte' => function($item, $prop, $value) { |
|
1563 | 1563 | return $item[$prop] >= $value; |
1564 | 1564 | }, |
1565 | - 'lt' => function ($item, $prop, $value) { |
|
1565 | + 'lt' => function($item, $prop, $value) { |
|
1566 | 1566 | return $item[$prop] < $value; |
1567 | 1567 | }, |
1568 | - 'le' => function ($item, $prop, $value) { |
|
1568 | + 'le' => function($item, $prop, $value) { |
|
1569 | 1569 | return $item[$prop] <= $value; |
1570 | 1570 | }, |
1571 | - 'lte' => function ($item, $prop, $value) { |
|
1571 | + 'lte' => function($item, $prop, $value) { |
|
1572 | 1572 | return $item[$prop] <= $value; |
1573 | 1573 | }, |
1574 | - 'ne' => function ($item, $prop, $value) { |
|
1574 | + 'ne' => function($item, $prop, $value) { |
|
1575 | 1575 | return $item[$prop] !== $value; |
1576 | 1576 | }, |
1577 | - 'contains' => function ($item, $prop, $value) { |
|
1577 | + 'contains' => function($item, $prop, $value) { |
|
1578 | 1578 | return \in_array($item[$prop], (array) $value, true); |
1579 | 1579 | }, |
1580 | - 'notContains' => function ($item, $prop, $value) { |
|
1580 | + 'notContains' => function($item, $prop, $value) { |
|
1581 | 1581 | return !\in_array($item[$prop], (array) $value, true); |
1582 | 1582 | }, |
1583 | - 'newer' => function ($item, $prop, $value) { |
|
1583 | + 'newer' => function($item, $prop, $value) { |
|
1584 | 1584 | return \strtotime($item[$prop]) > \strtotime($value); |
1585 | 1585 | }, |
1586 | - 'older' => function ($item, $prop, $value) { |
|
1586 | + 'older' => function($item, $prop, $value) { |
|
1587 | 1587 | return \strtotime($item[$prop]) < \strtotime($value); |
1588 | 1588 | }, |
1589 | 1589 | ]; |
@@ -1591,7 +1591,7 @@ discard block |
||
1591 | 1591 | $result = \array_values( |
1592 | 1592 | \array_filter( |
1593 | 1593 | (array) $this->array, |
1594 | - function ($item) use ( |
|
1594 | + function($item) use ( |
|
1595 | 1595 | $property, |
1596 | 1596 | $value, |
1597 | 1597 | $ops, |
@@ -1869,7 +1869,7 @@ discard block |
||
1869 | 1869 | protected function getPublicProperties(): array |
1870 | 1870 | { |
1871 | 1871 | static $PROPERTY_CACHE = []; |
1872 | - $cacheKey = 'Class::' . static::class; |
|
1872 | + $cacheKey = 'Class::'.static::class; |
|
1873 | 1873 | |
1874 | 1874 | if (isset($PROPERTY_CACHE[$cacheKey])) { |
1875 | 1875 | return $PROPERTY_CACHE[$cacheKey]; |
@@ -2226,7 +2226,7 @@ discard block |
||
2226 | 2226 | { |
2227 | 2227 | if ($this->checkPropertyTypes === true) { |
2228 | 2228 | if (isset($this->properties[$key]) === false) { |
2229 | - throw new \InvalidArgumentException('The key ' . $key . ' does not exists as @property in the class (' . \get_class($this) . ').'); |
|
2229 | + throw new \InvalidArgumentException('The key '.$key.' does not exists as @property in the class ('.\get_class($this).').'); |
|
2230 | 2230 | } |
2231 | 2231 | |
2232 | 2232 | $this->properties[$key]->checkType($value); |
@@ -2894,7 +2894,7 @@ discard block |
||
2894 | 2894 | } elseif (\is_array($item)) { |
2895 | 2895 | $result[$key] = self::create($item, $this->iteratorClass, false)->prependToEachKey($suffix)->toArray(); |
2896 | 2896 | } else { |
2897 | - $result[$key . $suffix] = $item; |
|
2897 | + $result[$key.$suffix] = $item; |
|
2898 | 2898 | } |
2899 | 2899 | } |
2900 | 2900 | |
@@ -2923,7 +2923,7 @@ discard block |
||
2923 | 2923 | } elseif (\is_object($item)) { |
2924 | 2924 | $result[$key] = $item; |
2925 | 2925 | } else { |
2926 | - $result[$key] = $item . $suffix; |
|
2926 | + $result[$key] = $item.$suffix; |
|
2927 | 2927 | } |
2928 | 2928 | } |
2929 | 2929 | |
@@ -3341,7 +3341,7 @@ discard block |
||
3341 | 3341 | public function replaceValues($search, $replacement = '') |
3342 | 3342 | { |
3343 | 3343 | $array = $this->each( |
3344 | - function ($value) use ($search, $replacement) { |
|
3344 | + function($value) use ($search, $replacement) { |
|
3345 | 3345 | return \str_replace($search, $replacement, $value); |
3346 | 3346 | } |
3347 | 3347 | ); |
@@ -3677,7 +3677,7 @@ discard block |
||
3677 | 3677 | |
3678 | 3678 | $that = $this; |
3679 | 3679 | $results = $arrayy->each( |
3680 | - function ($value) use ($sorter, $that) { |
|
3680 | + function($value) use ($sorter, $that) { |
|
3681 | 3681 | return \is_callable($sorter) ? $sorter($value) : $that->get($sorter, null, $value); |
3682 | 3682 | } |
3683 | 3683 | ); |
@@ -3792,7 +3792,7 @@ discard block |
||
3792 | 3792 | public function stripEmpty() |
3793 | 3793 | { |
3794 | 3794 | return $this->filter( |
3795 | - function ($item) { |
|
3795 | + function($item) { |
|
3796 | 3796 | if ($item === null) { |
3797 | 3797 | return false; |
3798 | 3798 | } |
@@ -3866,7 +3866,7 @@ discard block |
||
3866 | 3866 | |
3867 | 3867 | $this->array = \array_reduce( |
3868 | 3868 | $this->array, |
3869 | - function ($resultArray, $value) { |
|
3869 | + function($resultArray, $value) { |
|
3870 | 3870 | if (!\in_array($value, $resultArray, true)) { |
3871 | 3871 | $resultArray[] = $value; |
3872 | 3872 | } |
@@ -3899,7 +3899,7 @@ discard block |
||
3899 | 3899 | |
3900 | 3900 | $this->array = \array_reduce( |
3901 | 3901 | \array_keys($array), |
3902 | - function ($resultArray, $key) use ($array) { |
|
3902 | + function($resultArray, $key) use ($array) { |
|
3903 | 3903 | if (!\in_array($array[$key], $resultArray, true)) { |
3904 | 3904 | $resultArray[$key] = $array[$key]; |
3905 | 3905 | } |
@@ -214,7 +214,7 @@ |
||
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 | /** |
@@ -42,7 +42,7 @@ |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | if (!isset(static::$methodArgs[$name])) { |
45 | - throw new \BadMethodCallException($name . ' is not a valid method'); |
|
45 | + throw new \BadMethodCallException($name.' is not a valid method'); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | $numArgs = \count($arguments); |