@@ -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); |
@@ -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 | /** |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | public function where(string $keyOrPropertyOrMethod, $value): CollectionInterface |
172 | 172 | { |
173 | 173 | return $this->filter( |
174 | - function ($item) use ($keyOrPropertyOrMethod, $value) { |
|
174 | + function($item) use ($keyOrPropertyOrMethod, $value) { |
|
175 | 175 | $accessorValue = $this->extractValue( |
176 | 176 | $item, |
177 | 177 | $keyOrPropertyOrMethod |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | { |
206 | 206 | if ($this->checkType($this->collectionType, $value) === false) { |
207 | 207 | throw new \InvalidArgumentException( |
208 | - 'Value must be of type ' . $this->collectionType . '; value is ' . $this->valueToString($value) |
|
208 | + 'Value must be of type '.$this->collectionType.'; value is '.$this->valueToString($value) |
|
209 | 209 | ); |
210 | 210 | } |
211 | 211 | } |
@@ -318,10 +318,10 @@ discard block |
||
318 | 318 | |
319 | 319 | // resource |
320 | 320 | if (\is_resource($value)) { |
321 | - return \get_resource_type($value) . ' resource #' . (int) $value; |
|
321 | + return \get_resource_type($value).' resource #'.(int) $value; |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | // object |
325 | - return \get_class($value) . ' Object'; |
|
325 | + return \get_class($value).' Object'; |
|
326 | 326 | } |
327 | 327 | } |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | && |
106 | 106 | \count(\array_diff_key($this->properties, $data)) > 0 |
107 | 107 | ) { |
108 | - throw new \InvalidArgumentException('Property mismatch - input: ' . \print_r(\array_keys($data), true) . ' | expected: ' . \print_r(\array_keys($this->properties), true)); |
|
108 | + throw new \InvalidArgumentException('Property mismatch - input: '.\print_r(\array_keys($data), true).' | expected: '.\print_r(\array_keys($this->properties), true)); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | /** @noinspection AlterInForeachInspection */ |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | |
468 | 468 | $this->callAtPath( |
469 | 469 | $containerPath, |
470 | - static function ($container) use ($lastOffset, &$offsetExists) { |
|
470 | + static function($container) use ($lastOffset, &$offsetExists) { |
|
471 | 471 | $offsetExists = \array_key_exists($lastOffset, $container); |
472 | 472 | } |
473 | 473 | ); |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | |
542 | 542 | $this->callAtPath( |
543 | 543 | \implode($this->pathSeparator, $path), |
544 | - static function (&$offset) use ($pathToUnset) { |
|
544 | + static function(&$offset) use ($pathToUnset) { |
|
545 | 545 | unset($offset[$pathToUnset]); |
546 | 546 | } |
547 | 547 | ); |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | } |
582 | 582 | |
583 | 583 | if (\strpos($class, '\\') === 0) { |
584 | - $class = '\\' . $class; |
|
584 | + $class = '\\'.$class; |
|
585 | 585 | if (\class_exists($class)) { |
586 | 586 | $this->iteratorClass = $class; |
587 | 587 | |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | } |
590 | 590 | } |
591 | 591 | |
592 | - throw new \InvalidArgumentException('The iterator class does not exist: ' . $class); |
|
592 | + throw new \InvalidArgumentException('The iterator class does not exist: '.$class); |
|
593 | 593 | } |
594 | 594 | |
595 | 595 | /** |
@@ -697,13 +697,13 @@ discard block |
||
697 | 697 | |
698 | 698 | foreach ($this->getGenerator() as $key => $item) { |
699 | 699 | if ($item instanceof self) { |
700 | - $result[$prefix . $key] = $item->appendToEachKey($prefix); |
|
700 | + $result[$prefix.$key] = $item->appendToEachKey($prefix); |
|
701 | 701 | } elseif (\is_array($item)) { |
702 | - $result[$prefix . $key] = self::create($item, $this->iteratorClass, false) |
|
702 | + $result[$prefix.$key] = self::create($item, $this->iteratorClass, false) |
|
703 | 703 | ->appendToEachKey($prefix) |
704 | 704 | ->toArray(); |
705 | 705 | } else { |
706 | - $result[$prefix . $key] = $item; |
|
706 | + $result[$prefix.$key] = $item; |
|
707 | 707 | } |
708 | 708 | } |
709 | 709 | |
@@ -731,7 +731,7 @@ discard block |
||
731 | 731 | } elseif (\is_object($item)) { |
732 | 732 | $result[$key] = $item; |
733 | 733 | } else { |
734 | - $result[$key] = $prefix . $item; |
|
734 | + $result[$key] = $prefix.$item; |
|
735 | 735 | } |
736 | 736 | } |
737 | 737 | |
@@ -882,7 +882,7 @@ discard block |
||
882 | 882 | public function clean(): self |
883 | 883 | { |
884 | 884 | return $this->filter( |
885 | - static function ($value) { |
|
885 | + static function($value) { |
|
886 | 886 | return (bool) $value; |
887 | 887 | } |
888 | 888 | ); |
@@ -935,7 +935,7 @@ discard block |
||
935 | 935 | return $this->in_array_recursive( |
936 | 936 | \mb_strtoupper((string) $value), |
937 | 937 | $this->walk( |
938 | - static function (&$val) { |
|
938 | + static function(&$val) { |
|
939 | 939 | /** @noinspection PhpComposerExtensionStubsInspection */ |
940 | 940 | $val = \mb_strtoupper((string) $val); |
941 | 941 | }, |
@@ -949,7 +949,7 @@ discard block |
||
949 | 949 | return \in_array( |
950 | 950 | \mb_strtoupper((string) $value), |
951 | 951 | $this->walk( |
952 | - static function (&$val) { |
|
952 | + static function(&$val) { |
|
953 | 953 | /** @noinspection PhpComposerExtensionStubsInspection */ |
954 | 954 | $val = \mb_strtoupper((string) $val); |
955 | 955 | }, |
@@ -1240,7 +1240,7 @@ discard block |
||
1240 | 1240 | // trim all string in the array |
1241 | 1241 | \array_walk( |
1242 | 1242 | $array, |
1243 | - static function (&$val) { |
|
1243 | + static function(&$val) { |
|
1244 | 1244 | if (\is_string($val)) { |
1245 | 1245 | $val = \trim($val); |
1246 | 1246 | } |
@@ -1568,40 +1568,40 @@ discard block |
||
1568 | 1568 | } |
1569 | 1569 | |
1570 | 1570 | $ops = [ |
1571 | - 'eq' => static function ($item, $prop, $value) { |
|
1571 | + 'eq' => static function($item, $prop, $value) { |
|
1572 | 1572 | return $item[$prop] === $value; |
1573 | 1573 | }, |
1574 | - 'gt' => static function ($item, $prop, $value) { |
|
1574 | + 'gt' => static function($item, $prop, $value) { |
|
1575 | 1575 | return $item[$prop] > $value; |
1576 | 1576 | }, |
1577 | - 'ge' => static function ($item, $prop, $value) { |
|
1577 | + 'ge' => static function($item, $prop, $value) { |
|
1578 | 1578 | return $item[$prop] >= $value; |
1579 | 1579 | }, |
1580 | - 'gte' => static function ($item, $prop, $value) { |
|
1580 | + 'gte' => static function($item, $prop, $value) { |
|
1581 | 1581 | return $item[$prop] >= $value; |
1582 | 1582 | }, |
1583 | - 'lt' => static function ($item, $prop, $value) { |
|
1583 | + 'lt' => static function($item, $prop, $value) { |
|
1584 | 1584 | return $item[$prop] < $value; |
1585 | 1585 | }, |
1586 | - 'le' => static function ($item, $prop, $value) { |
|
1586 | + 'le' => static function($item, $prop, $value) { |
|
1587 | 1587 | return $item[$prop] <= $value; |
1588 | 1588 | }, |
1589 | - 'lte' => static function ($item, $prop, $value) { |
|
1589 | + 'lte' => static function($item, $prop, $value) { |
|
1590 | 1590 | return $item[$prop] <= $value; |
1591 | 1591 | }, |
1592 | - 'ne' => static function ($item, $prop, $value) { |
|
1592 | + 'ne' => static function($item, $prop, $value) { |
|
1593 | 1593 | return $item[$prop] !== $value; |
1594 | 1594 | }, |
1595 | - 'contains' => static function ($item, $prop, $value) { |
|
1595 | + 'contains' => static function($item, $prop, $value) { |
|
1596 | 1596 | return \in_array($item[$prop], (array) $value, true); |
1597 | 1597 | }, |
1598 | - 'notContains' => static function ($item, $prop, $value) { |
|
1598 | + 'notContains' => static function($item, $prop, $value) { |
|
1599 | 1599 | return !\in_array($item[$prop], (array) $value, true); |
1600 | 1600 | }, |
1601 | - 'newer' => static function ($item, $prop, $value) { |
|
1601 | + 'newer' => static function($item, $prop, $value) { |
|
1602 | 1602 | return \strtotime($item[$prop]) > \strtotime($value); |
1603 | 1603 | }, |
1604 | - 'older' => static function ($item, $prop, $value) { |
|
1604 | + 'older' => static function($item, $prop, $value) { |
|
1605 | 1605 | return \strtotime($item[$prop]) < \strtotime($value); |
1606 | 1606 | }, |
1607 | 1607 | ]; |
@@ -1609,7 +1609,7 @@ discard block |
||
1609 | 1609 | $result = \array_values( |
1610 | 1610 | \array_filter( |
1611 | 1611 | $this->getArray(), |
1612 | - static function ($item) use ( |
|
1612 | + static function($item) use ( |
|
1613 | 1613 | $property, |
1614 | 1614 | $value, |
1615 | 1615 | $ops, |
@@ -2130,7 +2130,7 @@ discard block |
||
2130 | 2130 | \array_uintersect( |
2131 | 2131 | $this->array, |
2132 | 2132 | $search, |
2133 | - static function ($a, $b) { |
|
2133 | + static function($a, $b) { |
|
2134 | 2134 | return $a === $b ? 0 : -1; |
2135 | 2135 | } |
2136 | 2136 | ), |
@@ -2835,7 +2835,7 @@ discard block |
||
2835 | 2835 | )->prependToEachKey($suffix) |
2836 | 2836 | ->toArray(); |
2837 | 2837 | } else { |
2838 | - $result[$key . $suffix] = $item; |
|
2838 | + $result[$key.$suffix] = $item; |
|
2839 | 2839 | } |
2840 | 2840 | } |
2841 | 2841 | |
@@ -2872,7 +2872,7 @@ discard block |
||
2872 | 2872 | } elseif (\is_object($item)) { |
2873 | 2873 | $result[$key] = $item; |
2874 | 2874 | } else { |
2875 | - $result[$key] = $item . $suffix; |
|
2875 | + $result[$key] = $item.$suffix; |
|
2876 | 2876 | } |
2877 | 2877 | } |
2878 | 2878 | |
@@ -3403,7 +3403,7 @@ discard block |
||
3403 | 3403 | public function replaceValues($search, $replacement = ''): self |
3404 | 3404 | { |
3405 | 3405 | $array = $this->each( |
3406 | - static function ($value) use ($search, $replacement) { |
|
3406 | + static function($value) use ($search, $replacement) { |
|
3407 | 3407 | return \str_replace($search, $replacement, $value); |
3408 | 3408 | } |
3409 | 3409 | ); |
@@ -3807,7 +3807,7 @@ discard block |
||
3807 | 3807 | |
3808 | 3808 | $that = $this; |
3809 | 3809 | $results = $arrayy->each( |
3810 | - static function ($value) use ($sorter, $that) { |
|
3810 | + static function($value) use ($sorter, $that) { |
|
3811 | 3811 | return \is_callable($sorter) ? $sorter($value) : $that->get($sorter, null, $value); |
3812 | 3812 | } |
3813 | 3813 | ); |
@@ -3865,7 +3865,7 @@ discard block |
||
3865 | 3865 | public function stripEmpty(): self |
3866 | 3866 | { |
3867 | 3867 | return $this->filter( |
3868 | - static function ($item) { |
|
3868 | + static function($item) { |
|
3869 | 3869 | if ($item === null) { |
3870 | 3870 | return false; |
3871 | 3871 | } |
@@ -3950,7 +3950,7 @@ discard block |
||
3950 | 3950 | // INFO: \array_unique() can't handle e.g. "stdClass"-values in an array |
3951 | 3951 | |
3952 | 3952 | $this->array = $this->reduce( |
3953 | - static function ($resultArray, $value) { |
|
3953 | + static function($resultArray, $value) { |
|
3954 | 3954 | if (!\in_array($value, $resultArray, true)) { |
3955 | 3955 | $resultArray[] = $value; |
3956 | 3956 | } |
@@ -3979,7 +3979,7 @@ discard block |
||
3979 | 3979 | |
3980 | 3980 | $this->array = \array_reduce( |
3981 | 3981 | \array_keys($array), |
3982 | - static function ($resultArray, $key) use ($array) { |
|
3982 | + static function($resultArray, $key) use ($array) { |
|
3983 | 3983 | if (!\in_array($array[$key], $resultArray, true)) { |
3984 | 3984 | $resultArray[$key] = $array[$key]; |
3985 | 3985 | } |
@@ -4435,7 +4435,7 @@ discard block |
||
4435 | 4435 | $this->properties !== [] |
4436 | 4436 | ) { |
4437 | 4437 | if (isset($this->properties[$key]) === false) { |
4438 | - throw new \InvalidArgumentException('The key ' . $key . ' does not exists as @property in the class (' . \get_class($this) . ').'); |
|
4438 | + throw new \InvalidArgumentException('The key '.$key.' does not exists as @property in the class ('.\get_class($this).').'); |
|
4439 | 4439 | } |
4440 | 4440 | |
4441 | 4441 | $this->properties[$key]->checkType($value); |
@@ -4587,7 +4587,7 @@ discard block |
||
4587 | 4587 | private function getPropertiesFromPhpDoc(): array |
4588 | 4588 | { |
4589 | 4589 | static $PROPERTY_CACHE = []; |
4590 | - $cacheKey = 'Class::' . static::class; |
|
4590 | + $cacheKey = 'Class::'.static::class; |
|
4591 | 4591 | |
4592 | 4592 | if (isset($PROPERTY_CACHE[$cacheKey])) { |
4593 | 4593 | return $PROPERTY_CACHE[$cacheKey]; |