@@ -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); |
@@ -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 | /** |
@@ -3641,7 +3641,7 @@ discard block |
||
| 3641 | 3641 | /** |
| 3642 | 3642 | * Apply the given function to every element in the array, discarding the results. |
| 3643 | 3643 | * |
| 3644 | - * @param \callable $callable |
|
| 3644 | + * @param \Closure $callable |
|
| 3645 | 3645 | * @param bool $recursive <p>Whether array will be walked recursively or no</p> |
| 3646 | 3646 | * |
| 3647 | 3647 | * @return static |
@@ -3733,8 +3733,8 @@ discard block |
||
| 3733 | 3733 | } |
| 3734 | 3734 | |
| 3735 | 3735 | /** |
| 3736 | - * @param mixed $path |
|
| 3737 | - * @param \callable $callable |
|
| 3736 | + * @param string $path |
|
| 3737 | + * @param \Closure $callable |
|
| 3738 | 3738 | * @param array|null $currentOffset |
| 3739 | 3739 | */ |
| 3740 | 3740 | protected function callAtPath($path, $callable, &$currentOffset = null) |
@@ -3878,7 +3878,7 @@ discard block |
||
| 3878 | 3878 | } |
| 3879 | 3879 | |
| 3880 | 3880 | /** |
| 3881 | - * @param mixed $glue |
|
| 3881 | + * @param string $glue |
|
| 3882 | 3882 | * @param array|static|string $pieces |
| 3883 | 3883 | * @param bool $useKeys |
| 3884 | 3884 | * |
@@ -99,12 +99,12 @@ discard block |
||
| 99 | 99 | && |
| 100 | 100 | \count(\array_diff_key($this->properties, $array)) > 0 |
| 101 | 101 | ) { |
| 102 | - throw new \InvalidArgumentException('Property mismatch - input: ' . \print_r(\array_keys($array), true) . ' | expected: ' . \print_r(\array_keys($this->properties), true)); |
|
| 102 | + throw new \InvalidArgumentException('Property mismatch - input: '.\print_r(\array_keys($array), true).' | expected: '.\print_r(\array_keys($this->properties), true)); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | \array_walk( |
| 106 | 106 | $array, |
| 107 | - function (&$value, &$key) { |
|
| 107 | + function(&$value, &$key) { |
|
| 108 | 108 | $this->internalSet($key, $value); |
| 109 | 109 | } |
| 110 | 110 | ); |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | |
| 429 | 429 | $this->callAtPath( |
| 430 | 430 | $containerPath, |
| 431 | - static function ($container) use ($lastOffset, &$offsetExists) { |
|
| 431 | + static function($container) use ($lastOffset, &$offsetExists) { |
|
| 432 | 432 | $offsetExists = \array_key_exists($lastOffset, $container); |
| 433 | 433 | } |
| 434 | 434 | ); |
@@ -488,7 +488,7 @@ discard block |
||
| 488 | 488 | |
| 489 | 489 | $this->callAtPath( |
| 490 | 490 | \implode($this->pathSeparator, $path), |
| 491 | - static function (&$offset) use ($pathToUnset) { |
|
| 491 | + static function(&$offset) use ($pathToUnset) { |
|
| 492 | 492 | unset($offset[$pathToUnset]); |
| 493 | 493 | } |
| 494 | 494 | ); |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | } |
| 524 | 524 | |
| 525 | 525 | if (\strpos($class, '\\') === 0) { |
| 526 | - $class = '\\' . $class; |
|
| 526 | + $class = '\\'.$class; |
|
| 527 | 527 | if (\class_exists($class)) { |
| 528 | 528 | $this->iteratorClass = $class; |
| 529 | 529 | |
@@ -531,7 +531,7 @@ discard block |
||
| 531 | 531 | } |
| 532 | 532 | } |
| 533 | 533 | |
| 534 | - throw new \InvalidArgumentException('The iterator class does not exist: ' . $class); |
|
| 534 | + throw new \InvalidArgumentException('The iterator class does not exist: '.$class); |
|
| 535 | 535 | } |
| 536 | 536 | |
| 537 | 537 | /** |
@@ -635,13 +635,13 @@ discard block |
||
| 635 | 635 | |
| 636 | 636 | foreach ($this->getGenerator() as $key => $item) { |
| 637 | 637 | if ($item instanceof self) { |
| 638 | - $result[$prefix . $key] = $item->appendToEachKey($prefix); |
|
| 638 | + $result[$prefix.$key] = $item->appendToEachKey($prefix); |
|
| 639 | 639 | } elseif (\is_array($item)) { |
| 640 | - $result[$prefix . $key] = self::create($item, $this->iteratorClass, false) |
|
| 640 | + $result[$prefix.$key] = self::create($item, $this->iteratorClass, false) |
|
| 641 | 641 | ->appendToEachKey($prefix) |
| 642 | 642 | ->toArray(); |
| 643 | 643 | } else { |
| 644 | - $result[$prefix . $key] = $item; |
|
| 644 | + $result[$prefix.$key] = $item; |
|
| 645 | 645 | } |
| 646 | 646 | } |
| 647 | 647 | |
@@ -669,7 +669,7 @@ discard block |
||
| 669 | 669 | } elseif (\is_object($item)) { |
| 670 | 670 | $result[$key] = $item; |
| 671 | 671 | } else { |
| 672 | - $result[$key] = $prefix . $item; |
|
| 672 | + $result[$key] = $prefix.$item; |
|
| 673 | 673 | } |
| 674 | 674 | } |
| 675 | 675 | |
@@ -818,7 +818,7 @@ discard block |
||
| 818 | 818 | public function clean(): self |
| 819 | 819 | { |
| 820 | 820 | return $this->filter( |
| 821 | - static function ($value) { |
|
| 821 | + static function($value) { |
|
| 822 | 822 | return (bool) $value; |
| 823 | 823 | } |
| 824 | 824 | ); |
@@ -870,7 +870,7 @@ discard block |
||
| 870 | 870 | return $this->in_array_recursive( |
| 871 | 871 | \mb_strtoupper((string) $value), |
| 872 | 872 | $this->walk( |
| 873 | - static function (&$val) { |
|
| 873 | + static function(&$val) { |
|
| 874 | 874 | /** @noinspection PhpComposerExtensionStubsInspection */ |
| 875 | 875 | $val = \mb_strtoupper((string) $val); |
| 876 | 876 | }, |
@@ -884,7 +884,7 @@ discard block |
||
| 884 | 884 | return \in_array( |
| 885 | 885 | \mb_strtoupper((string) $value), |
| 886 | 886 | $this->walk( |
| 887 | - static function (&$val) { |
|
| 887 | + static function(&$val) { |
|
| 888 | 888 | /** @noinspection PhpComposerExtensionStubsInspection */ |
| 889 | 889 | $val = \mb_strtoupper((string) $val); |
| 890 | 890 | }, |
@@ -1145,7 +1145,7 @@ discard block |
||
| 1145 | 1145 | // trim all string in the array |
| 1146 | 1146 | \array_walk( |
| 1147 | 1147 | $array, |
| 1148 | - static function (&$val) { |
|
| 1148 | + static function(&$val) { |
|
| 1149 | 1149 | if (\is_string($val)) { |
| 1150 | 1150 | $val = \trim($val); |
| 1151 | 1151 | } |
@@ -1453,40 +1453,40 @@ discard block |
||
| 1453 | 1453 | } |
| 1454 | 1454 | |
| 1455 | 1455 | $ops = [ |
| 1456 | - 'eq' => static function ($item, $prop, $value) { |
|
| 1456 | + 'eq' => static function($item, $prop, $value) { |
|
| 1457 | 1457 | return $item[$prop] === $value; |
| 1458 | 1458 | }, |
| 1459 | - 'gt' => static function ($item, $prop, $value) { |
|
| 1459 | + 'gt' => static function($item, $prop, $value) { |
|
| 1460 | 1460 | return $item[$prop] > $value; |
| 1461 | 1461 | }, |
| 1462 | - 'ge' => static function ($item, $prop, $value) { |
|
| 1462 | + 'ge' => static function($item, $prop, $value) { |
|
| 1463 | 1463 | return $item[$prop] >= $value; |
| 1464 | 1464 | }, |
| 1465 | - 'gte' => static function ($item, $prop, $value) { |
|
| 1465 | + 'gte' => static function($item, $prop, $value) { |
|
| 1466 | 1466 | return $item[$prop] >= $value; |
| 1467 | 1467 | }, |
| 1468 | - 'lt' => static function ($item, $prop, $value) { |
|
| 1468 | + 'lt' => static function($item, $prop, $value) { |
|
| 1469 | 1469 | return $item[$prop] < $value; |
| 1470 | 1470 | }, |
| 1471 | - 'le' => static function ($item, $prop, $value) { |
|
| 1471 | + 'le' => static function($item, $prop, $value) { |
|
| 1472 | 1472 | return $item[$prop] <= $value; |
| 1473 | 1473 | }, |
| 1474 | - 'lte' => static function ($item, $prop, $value) { |
|
| 1474 | + 'lte' => static function($item, $prop, $value) { |
|
| 1475 | 1475 | return $item[$prop] <= $value; |
| 1476 | 1476 | }, |
| 1477 | - 'ne' => static function ($item, $prop, $value) { |
|
| 1477 | + 'ne' => static function($item, $prop, $value) { |
|
| 1478 | 1478 | return $item[$prop] !== $value; |
| 1479 | 1479 | }, |
| 1480 | - 'contains' => static function ($item, $prop, $value) { |
|
| 1480 | + 'contains' => static function($item, $prop, $value) { |
|
| 1481 | 1481 | return \in_array($item[$prop], (array) $value, true); |
| 1482 | 1482 | }, |
| 1483 | - 'notContains' => static function ($item, $prop, $value) { |
|
| 1483 | + 'notContains' => static function($item, $prop, $value) { |
|
| 1484 | 1484 | return !\in_array($item[$prop], (array) $value, true); |
| 1485 | 1485 | }, |
| 1486 | - 'newer' => static function ($item, $prop, $value) { |
|
| 1486 | + 'newer' => static function($item, $prop, $value) { |
|
| 1487 | 1487 | return \strtotime($item[$prop]) > \strtotime($value); |
| 1488 | 1488 | }, |
| 1489 | - 'older' => static function ($item, $prop, $value) { |
|
| 1489 | + 'older' => static function($item, $prop, $value) { |
|
| 1490 | 1490 | return \strtotime($item[$prop]) < \strtotime($value); |
| 1491 | 1491 | }, |
| 1492 | 1492 | ]; |
@@ -1494,7 +1494,7 @@ discard block |
||
| 1494 | 1494 | $result = \array_values( |
| 1495 | 1495 | \array_filter( |
| 1496 | 1496 | (array) $this->array, |
| 1497 | - static function ($item) use ( |
|
| 1497 | + static function($item) use ( |
|
| 1498 | 1498 | $property, |
| 1499 | 1499 | $value, |
| 1500 | 1500 | $ops, |
@@ -2592,7 +2592,7 @@ discard block |
||
| 2592 | 2592 | } elseif (\is_array($item)) { |
| 2593 | 2593 | $result[$key] = self::create($item, $this->iteratorClass, false)->prependToEachKey($suffix)->toArray(); |
| 2594 | 2594 | } else { |
| 2595 | - $result[$key . $suffix] = $item; |
|
| 2595 | + $result[$key.$suffix] = $item; |
|
| 2596 | 2596 | } |
| 2597 | 2597 | } |
| 2598 | 2598 | |
@@ -2622,7 +2622,7 @@ discard block |
||
| 2622 | 2622 | } elseif (\is_object($item)) { |
| 2623 | 2623 | $result[$key] = $item; |
| 2624 | 2624 | } else { |
| 2625 | - $result[$key] = $item . $suffix; |
|
| 2625 | + $result[$key] = $item.$suffix; |
|
| 2626 | 2626 | } |
| 2627 | 2627 | } |
| 2628 | 2628 | |
@@ -3062,7 +3062,7 @@ discard block |
||
| 3062 | 3062 | public function replaceValues($search, $replacement = ''): self |
| 3063 | 3063 | { |
| 3064 | 3064 | $array = $this->each( |
| 3065 | - static function ($value) use ($search, $replacement) { |
|
| 3065 | + static function($value) use ($search, $replacement) { |
|
| 3066 | 3066 | return \str_replace($search, $replacement, $value); |
| 3067 | 3067 | } |
| 3068 | 3068 | ); |
@@ -3418,7 +3418,7 @@ discard block |
||
| 3418 | 3418 | |
| 3419 | 3419 | $that = $this; |
| 3420 | 3420 | $results = $arrayy->each( |
| 3421 | - static function ($value) use ($sorter, $that) { |
|
| 3421 | + static function($value) use ($sorter, $that) { |
|
| 3422 | 3422 | return \is_callable($sorter) ? $sorter($value) : $that->get($sorter, null, $value); |
| 3423 | 3423 | } |
| 3424 | 3424 | ); |
@@ -3466,7 +3466,7 @@ discard block |
||
| 3466 | 3466 | public function stripEmpty(): self |
| 3467 | 3467 | { |
| 3468 | 3468 | return $this->filter( |
| 3469 | - static function ($item) { |
|
| 3469 | + static function($item) { |
|
| 3470 | 3470 | if ($item === null) { |
| 3471 | 3471 | return false; |
| 3472 | 3472 | } |
@@ -3543,7 +3543,7 @@ discard block |
||
| 3543 | 3543 | |
| 3544 | 3544 | $this->array = \array_reduce( |
| 3545 | 3545 | $this->array, |
| 3546 | - static function ($resultArray, $value) { |
|
| 3546 | + static function($resultArray, $value) { |
|
| 3547 | 3547 | if (!\in_array($value, $resultArray, true)) { |
| 3548 | 3548 | $resultArray[] = $value; |
| 3549 | 3549 | } |
@@ -3577,7 +3577,7 @@ discard block |
||
| 3577 | 3577 | |
| 3578 | 3578 | $this->array = \array_reduce( |
| 3579 | 3579 | \array_keys($array), |
| 3580 | - static function ($resultArray, $key) use ($array) { |
|
| 3580 | + static function($resultArray, $key) use ($array) { |
|
| 3581 | 3581 | if (!\in_array($array[$key], $resultArray, true)) { |
| 3582 | 3582 | $resultArray[$key] = $array[$key]; |
| 3583 | 3583 | } |
@@ -3857,7 +3857,7 @@ discard block |
||
| 3857 | 3857 | protected function getPublicProperties(): array |
| 3858 | 3858 | { |
| 3859 | 3859 | static $PROPERTY_CACHE = []; |
| 3860 | - $cacheKey = 'Class::' . static::class; |
|
| 3860 | + $cacheKey = 'Class::'.static::class; |
|
| 3861 | 3861 | |
| 3862 | 3862 | if (isset($PROPERTY_CACHE[$cacheKey])) { |
| 3863 | 3863 | return $PROPERTY_CACHE[$cacheKey]; |
@@ -4018,7 +4018,7 @@ discard block |
||
| 4018 | 4018 | { |
| 4019 | 4019 | if ($this->checkPropertyTypes === true) { |
| 4020 | 4020 | if (isset($this->properties[$key]) === false) { |
| 4021 | - throw new \InvalidArgumentException('The key ' . $key . ' does not exists as @property in the class (' . \get_class($this) . ').'); |
|
| 4021 | + throw new \InvalidArgumentException('The key '.$key.' does not exists as @property in the class ('.\get_class($this).').'); |
|
| 4022 | 4022 | } |
| 4023 | 4023 | |
| 4024 | 4024 | $this->properties[$key]->checkType($value); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | $expectedTypes = \implode('|', $this->getTypes()); |
| 75 | 75 | |
| 76 | - throw new \InvalidArgumentException("Invalid type: expected {$this->name} to be of type {{$expectedTypes}}, instead got value `" . \print_r($value, true) . "` with type {{$type}}."); |
|
| 76 | + throw new \InvalidArgumentException("Invalid type: expected {$this->name} to be of type {{$expectedTypes}}, instead got value `".\print_r($value, true)."` with type {{$type}}."); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | public static function fromPhpDocumentorProperty(\phpDocumentor\Reflection\DocBlock\Tags\Property $phpDocumentorReflectionProperty): self |
@@ -137,9 +137,9 @@ discard block |
||
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | if ($type instanceof \phpDocumentor\Reflection\Types\Array_) { |
| 140 | - $valueTypeTmp = $type->getValueType() . ''; |
|
| 140 | + $valueTypeTmp = $type->getValueType().''; |
|
| 141 | 141 | if ($valueTypeTmp !== 'mixed') { |
| 142 | - return $valueTypeTmp . '[]'; |
|
| 142 | + return $valueTypeTmp.'[]'; |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | return 'array'; |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | return 'resource'; |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | - return $type . ''; |
|
| 188 | + return $type.''; |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | /** |