From 7b5ae90b3a631f3a9772f15cf16fc2fecdcf7f2b Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Tue, 12 Dec 2023 16:16:47 +0200 Subject: [PATCH 1/2] Fix compile script --- bin/compile | 2 -- src/Object/get.php | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/bin/compile b/bin/compile index 2422749..1018030 100755 --- a/bin/compile +++ b/bin/compile @@ -5,8 +5,6 @@ declare(strict_types=1); -require_once dirname(__DIR__).'/vendor/autoload.php'; - function getCode(SplFileInfo $file): string { $code = php_strip_whitespace($file->getRealPath()); diff --git a/src/Object/get.php b/src/Object/get.php index 84e8268..3a0c66d 100644 --- a/src/Object/get.php +++ b/src/Object/get.php @@ -1,6 +1,6 @@ Date: Tue, 12 Dec 2023 16:32:12 +0200 Subject: [PATCH 2/2] Replace PHP-CS-Fixer with ECS --- .github/workflows/cs.yml | 6 +- .php-version | 2 +- composer.json | 6 +- ecs.php | 77 ++++++++++++++++++++++++++ src/Array/differenceBy.php | 5 +- src/Array/differenceWith.php | 5 +- src/Array/findIndex.php | 2 +- src/Array/fromPairs.php | 2 +- src/Array/indexOf.php | 2 +- src/Array/intersection.php | 2 - src/Array/intersectionBy.php | 1 - src/Array/intersectionWith.php | 3 +- src/Array/lastIndexOf.php | 2 +- src/Array/pull.php | 4 +- src/Array/pullAt.php | 2 +- src/Array/remove.php | 2 +- src/Array/unionBy.php | 1 - src/Array/unionWith.php | 7 +-- src/Array/unzip.php | 2 +- src/Array/unzipWith.php | 4 +- src/Array/zipObject.php | 2 +- src/Array/zipObjectDeep.php | 2 +- src/Array/zipWith.php | 1 - src/CacheInterface.php | 4 +- src/Collection/countBy.php | 2 +- src/Collection/every.php | 2 +- src/Collection/groupBy.php | 2 +- src/Collection/invokeMap.php | 7 ++- src/Collection/sortBy.php | 4 +- src/Function/after.php | 4 +- src/Function/ary.php | 2 +- src/Function/flip.php | 3 - src/Function/memoize.php | 5 +- src/Function/negate.php | 4 +- src/Hash.php | 2 +- src/Lang/eq.php | 2 +- src/Lang/isEqual.php | 2 +- src/Lang/isError.php | 2 +- src/ListCache.php | 2 +- src/Lodash.php | 15 +++-- src/MapCache.php | 8 +-- src/Math/add.php | 2 +- src/Math/max.php | 2 +- src/Math/maxBy.php | 2 +- src/Object/get.php | 2 +- src/Object/pick.php | 2 +- src/Object/pickBy.php | 2 +- src/String/camelCase.php | 2 +- src/String/deburr.php | 6 +- src/String/escape.php | 1 - src/String/replace.php | 4 +- src/String/template.php | 12 ++-- src/String/truncate.php | 4 +- src/Util/defaultTo.php | 4 +- src/Util/property.php | 2 +- src/bootstrap.php | 8 +-- src/internal/Traits/CacheDataTrait.php | 2 +- src/internal/arrayMap.php | 2 +- src/internal/arrayPush.php | 2 +- src/internal/assocIndexOf.php | 2 +- src/internal/baseFlatten.php | 2 +- src/internal/baseGet.php | 6 +- src/internal/baseIntersection.php | 8 +-- src/internal/baseInvoke.php | 7 ++- src/internal/baseMatches.php | 2 +- src/internal/baseOrderBy.php | 2 +- src/internal/basePick.php | 4 +- src/internal/basePickBy.php | 2 +- src/internal/baseReduce.php | 2 +- src/internal/baseRest.php | 2 +- src/internal/baseSet.php | 8 +-- src/internal/baseTimes.php | 2 +- src/internal/baseUnary.php | 2 +- src/internal/baseUniq.php | 9 ++- src/internal/castPath.php | 2 +- src/internal/castSlice.php | 2 +- src/internal/compareMultiple.php | 2 +- src/internal/createAggregator.php | 2 +- src/internal/createMathOperation.php | 2 +- src/internal/flatRest.php | 2 +- src/internal/hasUnicode.php | 4 +- src/internal/isIterateeCall.php | 2 +- src/internal/isKey.php | 2 +- src/internal/memoizeCapped.php | 2 +- src/internal/overRest.php | 2 +- src/internal/parent.php | 2 +- src/internal/shortOut.php | 2 +- src/internal/stringToPath.php | 2 +- src/internal/unicode.php | 48 ++++++++-------- src/internal/unicodeToArray.php | 2 +- src/internal/unicodeWords.php | 12 ++-- tests/Array/DropWhileTest.php | 2 +- tests/Array/FlattenDeepTest.php | 2 +- tests/Array/FlattenDepthTest.php | 2 +- tests/Array/FlattenTest.php | 2 +- tests/Array/HeadTest.php | 2 +- tests/Array/InitialTest.php | 2 +- tests/Array/IntersectionTest.php | 2 +- tests/Array/LastIndexOfTest.php | 2 +- tests/Array/LastTest.php | 2 +- tests/Array/NthTest.php | 2 +- tests/Array/PullAllByTest.php | 2 +- tests/Array/PullAllTest.php | 2 +- tests/Array/PullTest.php | 2 +- tests/Array/SliceTest.php | 2 +- tests/Array/TailTest.php | 2 +- tests/Array/UnionByTest.php | 2 +- tests/Array/UnionTest.php | 2 +- tests/Array/UniqByTest.php | 2 +- tests/Array/UniqTest.php | 2 +- tests/Array/UnzipWithTest.php | 2 +- tests/Array/ZipObjectTest.php | 2 +- tests/Array/ZipWithTest.php | 2 +- tests/Collection/CountByTest.php | 2 +- tests/Collection/EachRightTest.php | 2 +- tests/Collection/FilterTest.php | 2 +- tests/Collection/FlatMapDepthTest.php | 2 +- tests/Collection/InvokeMapTest.php | 2 +- tests/Collection/ReduceTest.php | 2 +- tests/Collection/SampleTest.php | 2 +- tests/Collection/ShuffleTest.php | 2 +- tests/Collection/SizeTest.php | 4 +- tests/Date/NowTest.php | 2 +- tests/Function/AfterTest.php | 2 +- tests/Function/AryTest.php | 2 +- tests/Function/BeforeTest.php | 4 +- tests/Function/BindKeyTest.php | 4 +- tests/Function/BindTest.php | 6 +- tests/Function/DelayTest.php | 2 +- tests/Function/PartialTest.php | 2 +- tests/Function/RestTest.php | 4 +- tests/Function/SpreadTest.php | 2 +- tests/Function/UnaryTest.php | 2 +- tests/Function/WrapTest.php | 2 +- tests/Lang/IsErrorTest.php | 2 +- tests/LodashTest.php | 7 +++ tests/Number/ClampTest.php | 2 +- tests/Number/RandomTest.php | 2 +- tests/Object/GetTest.php | 53 +++++++++--------- tests/Seq/ChainTest.php | 2 +- tests/String/CamelCaseTest.php | 2 +- tests/String/EscapeRegExpTest.php | 2 +- tests/String/KebabCaseTest.php | 2 +- tests/String/PadStartTest.php | 2 +- tests/String/StartCaseTest.php | 2 +- tests/String/StartsWithTest.php | 2 +- tests/String/TrimEndTest.php | 2 +- tests/String/TrimStartTest.php | 2 +- tests/Util/DefaultToTest.php | 17 +++--- tests/Util/PropertyTest.php | 2 +- 150 files changed, 357 insertions(+), 271 deletions(-) create mode 100644 ecs.php diff --git a/.github/workflows/cs.yml b/.github/workflows/cs.yml index a269994..52122c8 100644 --- a/.github/workflows/cs.yml +++ b/.github/workflows/cs.yml @@ -16,7 +16,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: 8.2 tools: composer - name: Get composer cache directory @@ -33,5 +33,5 @@ jobs: - name: Install dependencies run: composer install --prefer-dist - - name: PHP-CS-Fixer - run: vendor/bin/php-cs-fixer fix --dry-run -v + - name: ECS + run: vendor/bin/ecs diff --git a/.php-version b/.php-version index 37722eb..0f0fefa 100644 --- a/.php-version +++ b/.php-version @@ -1 +1 @@ -7.4 +7.1 diff --git a/composer.json b/composer.json index 3fb0d3a..a656ebd 100644 --- a/composer.json +++ b/composer.json @@ -28,10 +28,10 @@ "symfony/property-access": "^2.7 | ^3.0 | ^4.0 | ^5.0" }, "require-dev": { - "phpdocumentor/reflection-docblock": "*", + "phpdocumentor/reflection-docblock": "^4.3 || 5.2", "phpstan/phpdoc-parser": "*", "phpunit/phpunit": "^7.3 || ^8.4", - "phpstan/phpstan": "^0.12", - "friendsofphp/php-cs-fixer": "^2.12" + "phpstan/phpstan": "*", + "symplify/easy-coding-standard": ">=10.0,<= 13.0" } } diff --git a/ecs.php b/ecs.php new file mode 100644 index 0000000..ab6d8c9 --- /dev/null +++ b/ecs.php @@ -0,0 +1,77 @@ + + * @copyright Copyright (c) 2017 + */ + +use PhpCsFixer\Fixer\Casing\MagicConstantCasingFixer; +use PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer; +use PhpCsFixer\Fixer\ClassNotation\SelfAccessorFixer; +use PhpCsFixer\Fixer\ClassNotation\SingleClassElementPerStatementFixer; +use PhpCsFixer\Fixer\Comment\HeaderCommentFixer; +use PhpCsFixer\Fixer\ControlStructure\NoUselessElseFixer; +use PhpCsFixer\Fixer\FunctionNotation\VoidReturnFixer; +use PhpCsFixer\Fixer\Import\OrderedImportsFixer; +use PhpCsFixer\Fixer\LanguageConstruct\ExplicitIndirectVariableFixer; +use PhpCsFixer\Fixer\LanguageConstruct\FunctionToConstantFixer; +use PhpCsFixer\Fixer\Operator\NewWithBracesFixer; +use PhpCsFixer\Fixer\Operator\StandardizeIncrementFixer; +use PhpCsFixer\Fixer\PhpUnit\PhpUnitMethodCasingFixer; +use PhpCsFixer\Fixer\StringNotation\ExplicitStringVariableFixer; +use PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer; +use Symplify\EasyCodingStandard\Config\ECSConfig; +use Symplify\EasyCodingStandard\ValueObject\Set\SetList; + +return static function (ECSConfig $ecsConfig): void { + $ecsConfig->paths([ + __DIR__ . '/src', + __DIR__ . '/tests', + __FILE__, + ]); + + $ecsConfig->sets([ + SetList::PSR_12, + SetList::SPACES, + SetList::DOCBLOCK, + SetList::COMMENTS, + SetList::PHPUNIT, + SetList::NAMESPACES, + SetList::CLEAN_CODE, + ]); + + $ecsConfig->rules([ + PhpUnitMethodCasingFixer::class, + FunctionToConstantFixer::class, + ExplicitStringVariableFixer::class, + ExplicitIndirectVariableFixer::class, + NewWithBracesFixer::class, + StandardizeIncrementFixer::class, + SelfAccessorFixer::class, + MagicConstantCasingFixer::class, + NoUselessElseFixer::class, + SingleQuoteFixer::class, + // VoidReturnFixer::class, + ]); + + $header = <<<'EOF' +This file is part of the SolidWorx Lodash-PHP project. + +@author Pierre du Plessis +@copyright Copyright (c) 2017 +EOF; + + $ecsConfig->ruleWithConfiguration(SingleClassElementPerStatementFixer::class, ['elements' => ['const', 'property']]); + $ecsConfig->ruleWithConfiguration(ClassDefinitionFixer::class, ['single_line' => \true]); + $ecsConfig->ruleWithConfiguration(OrderedImportsFixer::class, ['imports_order' => ['const', 'class', 'function']]); + $ecsConfig->ruleWithConfiguration(HeaderCommentFixer::class, [ + 'comment_type' => 'comment', + 'header' => \trim($header), + 'location' => 'after_declare_strict', + 'separate' => 'both', + ]); +}; diff --git a/src/Array/differenceBy.php b/src/Array/differenceBy.php index 8c5a7ca..e16ecdc 100644 --- a/src/Array/differenceBy.php +++ b/src/Array/differenceBy.php @@ -26,7 +26,6 @@ * * @param array $array The array to inspect. * @param array ...$values The values to exclude. - * @param callable $iteratee The iteratee invoked per element. * * @return array Returns the new array of filtered values. * @@ -38,11 +37,11 @@ */ function differenceBy(array $array, ...$values): array { - if (!$array) { + if (! $array) { return []; } - if (!\is_callable(\end($values))) { + if (! \is_callable(\end($values))) { return difference($array, ...$values); } diff --git a/src/Array/differenceWith.php b/src/Array/differenceWith.php index 912e117..6b55bfc 100644 --- a/src/Array/differenceWith.php +++ b/src/Array/differenceWith.php @@ -25,7 +25,6 @@ * * @param array $array The array to inspect. * @param array ...$values The values to exclude. - * @param callable $comparator The comparator invoked per element. * * @return array Returns the new array of filtered values. * @@ -41,11 +40,11 @@ */ function differenceWith(array $array, ...$values): array { - if (!$array) { + if (! $array) { return []; } - if (!\is_callable(\end($values))) { + if (! \is_callable(\end($values))) { return difference($array, ...$values); } diff --git a/src/Array/findIndex.php b/src/Array/findIndex.php index 36b9737..d062945 100644 --- a/src/Array/findIndex.php +++ b/src/Array/findIndex.php @@ -50,7 +50,7 @@ function findIndex(array $array, $predicate, int $fromIndex = null): int { $length = \count($array); - if (!$length) { + if (! $length) { return -1; } diff --git a/src/Array/fromPairs.php b/src/Array/fromPairs.php index 7541e04..6af0ddb 100644 --- a/src/Array/fromPairs.php +++ b/src/Array/fromPairs.php @@ -32,7 +32,7 @@ */ function fromPairs(array $pairs): \stdClass { - if (!\count($pairs)) { + if (! \count($pairs)) { return new \stdClass(); } diff --git a/src/Array/indexOf.php b/src/Array/indexOf.php index db81dbe..7878646 100644 --- a/src/Array/indexOf.php +++ b/src/Array/indexOf.php @@ -45,7 +45,7 @@ function indexOf(array $array, $value, int $fromIndex = null): int $array = \array_reverse($array, false); $inc = false; } - }; + } foreach ($array as $v) { if (isEqual($value, $v)) { diff --git a/src/Array/intersection.php b/src/Array/intersection.php index 6d05520..9cdba2a 100644 --- a/src/Array/intersection.php +++ b/src/Array/intersection.php @@ -19,8 +19,6 @@ * * @category Array * - * @param array ...$arrays - * * @return array the new array of intersecting values. * * @example diff --git a/src/Array/intersectionBy.php b/src/Array/intersectionBy.php index 44ca1c5..27f0393 100644 --- a/src/Array/intersectionBy.php +++ b/src/Array/intersectionBy.php @@ -24,7 +24,6 @@ * @category Array * * @param array ...$arrays - * @param callable $iteratee The iteratee invoked per element. * * @return array the new array of intersecting values. * @example diff --git a/src/Array/intersectionWith.php b/src/Array/intersectionWith.php index be8dbd4..7a09730 100644 --- a/src/Array/intersectionWith.php +++ b/src/Array/intersectionWith.php @@ -22,7 +22,6 @@ * @category Array * * @param array ...$arrays - * @param callable $comparator The comparator invoked per element. * * @return array the new array of intersecting values. * @@ -40,7 +39,7 @@ function intersectionWith(...$arrays /*, callable $comparator = null*/): array $copy = $arrays; $comparator = \array_pop($arrays); - if (!\is_callable($comparator)) { + if (! \is_callable($comparator)) { $arrays = $copy; $comparator = null; } diff --git a/src/Array/lastIndexOf.php b/src/Array/lastIndexOf.php index f1ba610..9e49a36 100644 --- a/src/Array/lastIndexOf.php +++ b/src/Array/lastIndexOf.php @@ -39,7 +39,7 @@ function lastIndexOf(array $array, $value, int $fromIndex = null): int if (null !== $fromIndex) { $index = $fromIndex > 0 ? $fromIndex : \count($array) - 1; $array = \array_slice($array, 0, -$fromIndex + 1); - }; + } foreach (\array_reverse($array, false) as $v) { if (isEqual($value, $v)) { diff --git a/src/Array/pull.php b/src/Array/pull.php index f585be2..faecccc 100644 --- a/src/Array/pull.php +++ b/src/Array/pull.php @@ -24,8 +24,6 @@ * @param array $array The array to modify. * @param array $values The values to remove. * - * @return array - * * @example * * $array = ['a', 'b', 'c', 'a', 'b', 'c'] @@ -38,7 +36,7 @@ function pull(array &$array, ...$values): array { $array = \array_filter($array, function ($val) use ($values) { - return !\in_array($val, $values, true); + return ! \in_array($val, $values, true); }); $array = \array_values($array); // Re-index array diff --git a/src/Array/pullAt.php b/src/Array/pullAt.php index 19e53bc..81af249 100644 --- a/src/Array/pullAt.php +++ b/src/Array/pullAt.php @@ -47,7 +47,7 @@ function pullAt(array &$array, $indexes): array $pulled[] = $val; } - return !$inArray; + return ! $inArray; }, \ARRAY_FILTER_USE_BOTH); $array = \array_values($array); diff --git a/src/Array/remove.php b/src/Array/remove.php index a939bf5..157dabe 100644 --- a/src/Array/remove.php +++ b/src/Array/remove.php @@ -47,7 +47,7 @@ function remove(array &$array, callable $predicate): array $resultArray[] = $val; } - return !$result; + return ! $result; }, \ARRAY_FILTER_USE_BOTH); $array = \array_values($array); // Re-index array diff --git a/src/Array/unionBy.php b/src/Array/unionBy.php index af400c6..6f0cf5d 100644 --- a/src/Array/unionBy.php +++ b/src/Array/unionBy.php @@ -25,7 +25,6 @@ * @category Array * * @param array ...$arrays The arrays to inspect. - * @param callable $iteratee The iteratee invoked per element. * * @return array the new array of combined values. * diff --git a/src/Array/unionWith.php b/src/Array/unionWith.php index 56b2071..103f663 100644 --- a/src/Array/unionWith.php +++ b/src/Array/unionWith.php @@ -23,7 +23,6 @@ * @category Array * * @param array ...$arrays The arrays to inspect. - * @param callable $comparator The comparator invoked per element. * * @return array the new array of combined values. * @@ -38,13 +37,13 @@ * // => [['x' => 1, 'y' => 2], ['x' => 2, 'y' => 1], ['x' => 1, 'y' => 1]] * */ -function unionWith(... $arrays): array +function unionWith(...$arrays): array { /** @var callable $comparator */ $comparator = \array_pop($arrays); - if (!\is_callable($comparator)) { - throw new \InvalidArgumentException(__FUNCTION__.' expects the last value passed to be callable'); + if (! \is_callable($comparator)) { + throw new \InvalidArgumentException(__FUNCTION__ . ' expects the last value passed to be callable'); } return baseUniq(baseFlatten($arrays, 1, '\is_array', true), null, $comparator); diff --git a/src/Array/unzip.php b/src/Array/unzip.php index 60c24e5..7314363 100644 --- a/src/Array/unzip.php +++ b/src/Array/unzip.php @@ -36,7 +36,7 @@ */ function unzip(array $array): array { - if (!\count($array)) { + if (! \count($array)) { return []; } diff --git a/src/Array/unzipWith.php b/src/Array/unzipWith.php index 17365f8..8c1f516 100644 --- a/src/Array/unzipWith.php +++ b/src/Array/unzipWith.php @@ -36,12 +36,12 @@ */ function unzipWith(array $array, ?callable $iteratee = null): array { - if (!\count($array)) { + if (! \count($array)) { return []; } $result = unzip($array); - if (!is_callable($iteratee)) { + if (! is_callable($iteratee)) { return $result; } diff --git a/src/Array/zipObject.php b/src/Array/zipObject.php index 69fd505..2cfa06e 100644 --- a/src/Array/zipObject.php +++ b/src/Array/zipObject.php @@ -34,7 +34,7 @@ */ function zipObject(array $props = [], array $values = []) { - $result = new \stdClass; + $result = new \stdClass(); $index = -1; $length = \count($props); $props = \array_values($props); diff --git a/src/Array/zipObjectDeep.php b/src/Array/zipObjectDeep.php index dd8defc..a9b1c1e 100644 --- a/src/Array/zipObjectDeep.php +++ b/src/Array/zipObjectDeep.php @@ -44,7 +44,7 @@ */ function zipObjectDeep(array $props = [], array $values = []): \stdClass { - $result = new \stdClass; + $result = new \stdClass(); $index = -1; $length = \count($props); $props = \array_values($props); diff --git a/src/Array/zipWith.php b/src/Array/zipWith.php index 58727f0..a11d452 100644 --- a/src/Array/zipWith.php +++ b/src/Array/zipWith.php @@ -19,7 +19,6 @@ * @category Array * * @param array ...$arrays The arrays to process. - * @param callable $iteratee The function to combine grouped values. * * @return array the new array of grouped elements. * diff --git a/src/CacheInterface.php b/src/CacheInterface.php index 096a0b7..f68dbe5 100644 --- a/src/CacheInterface.php +++ b/src/CacheInterface.php @@ -6,14 +6,14 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _; interface CacheInterface { - public function set($key, $value): CacheInterface; + public function set($key, $value): self; public function get($key); diff --git a/src/Collection/countBy.php b/src/Collection/countBy.php index ae2dd51..400de34 100644 --- a/src/Collection/countBy.php +++ b/src/Collection/countBy.php @@ -38,7 +38,7 @@ function countBy(iterable $collection, callable $iteratee): array { return createAggregator(function ($result, $key, $value) { - if (!isset($result[$value])) { + if (! isset($result[$value])) { $result[$value] = 0; } diff --git a/src/Collection/every.php b/src/Collection/every.php index 6ee989a..fc6541d 100644 --- a/src/Collection/every.php +++ b/src/Collection/every.php @@ -58,7 +58,7 @@ function every(iterable $collection, $predicate): bool $iteratee = baseIteratee($predicate); foreach ($collection as $key => $value) { - if (!$iteratee($value, $key, $collection)) { + if (! $iteratee($value, $key, $collection)) { return false; } } diff --git a/src/Collection/groupBy.php b/src/Collection/groupBy.php index 2295d56..3f2e137 100644 --- a/src/Collection/groupBy.php +++ b/src/Collection/groupBy.php @@ -38,7 +38,7 @@ function groupBy(iterable $collection, $iteratee): array { return createAggregator(function ($result, $value, $key) { - if (!isset($result[$key])) { + if (! isset($result[$key])) { $result[$key] = []; } diff --git a/src/Collection/invokeMap.php b/src/Collection/invokeMap.php index b5b4ddd..e602546 100644 --- a/src/Collection/invokeMap.php +++ b/src/Collection/invokeMap.php @@ -1,6 +1,11 @@ + * @copyright Copyright (c) 2017 + */ /* * This file is part of the SolidWorx Lodash-PHP project. diff --git a/src/Collection/sortBy.php b/src/Collection/sortBy.php index 0e2e41c..debdeeb 100644 --- a/src/Collection/sortBy.php +++ b/src/Collection/sortBy.php @@ -45,9 +45,9 @@ function sortBy($collection, $iteratees): array { if (null === $collection) { return []; - }; + } - if (\is_callable($iteratees) || !\is_iterable($iteratees)) { + if (\is_callable($iteratees) || ! \is_iterable($iteratees)) { $iteratees = [$iteratees]; } diff --git a/src/Function/after.php b/src/Function/after.php index 6a972c1..569331d 100644 --- a/src/Function/after.php +++ b/src/Function/after.php @@ -18,9 +18,9 @@ * @category Function * * @param int $n The number of calls before `func` is invoked. - * @param Callable $func The function to restrict. + * @param callable $func The function to restrict. * - * @return Callable Returns the new restricted function. + * @return callable Returns the new restricted function. * * @example * diff --git a/src/Function/ary.php b/src/Function/ary.php index 47d5436..9fc8090 100644 --- a/src/Function/ary.php +++ b/src/Function/ary.php @@ -20,7 +20,7 @@ * @param callable $func The function to cap arguments for. * @param int $n The arity cap. * - * @return Callable Returns the new capped function. + * @return callable Returns the new capped function. * * @example * diff --git a/src/Function/flip.php b/src/Function/flip.php index 91c1e33..038c9be 100644 --- a/src/Function/flip.php +++ b/src/Function/flip.php @@ -11,9 +11,6 @@ namespace _; -use function _\internal\baseRest; -use function _\internal\castSlice; - /** * Creates a function that invokes `func` with arguments reversed. * diff --git a/src/Function/memoize.php b/src/Function/memoize.php index 13ec3a1..e019a05 100644 --- a/src/Function/memoize.php +++ b/src/Function/memoize.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _; @@ -55,7 +55,6 @@ function memoize(callable $func, callable $resolver = null) { $memoized = new class($func, $resolver ?? null) { - /** * @var CacheInterface */ @@ -94,7 +93,7 @@ public function __invoke() } }; - $memoized->cache = new MapCache; + $memoized->cache = new MapCache(); return $memoized; } diff --git a/src/Function/negate.php b/src/Function/negate.php index 4032304..59a2a39 100644 --- a/src/Function/negate.php +++ b/src/Function/negate.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _; @@ -34,6 +34,6 @@ function negate(callable $predicate): callable { return function () use ($predicate) { - return !$predicate(...\func_get_args()); + return ! $predicate(...\func_get_args()); }; } diff --git a/src/Hash.php b/src/Hash.php index 365b8f8..47d7a24 100644 --- a/src/Hash.php +++ b/src/Hash.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _; diff --git a/src/Lang/eq.php b/src/Lang/eq.php index 4f1a280..2ad5f8f 100644 --- a/src/Lang/eq.php +++ b/src/Lang/eq.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _; diff --git a/src/Lang/isEqual.php b/src/Lang/isEqual.php index a0c210b..395db53 100644 --- a/src/Lang/isEqual.php +++ b/src/Lang/isEqual.php @@ -45,7 +45,7 @@ */ function isEqual($value, $other): bool { - $factory = new Factory; + $factory = new Factory(); $comparator = $factory->getComparatorFor($value, $other); try { diff --git a/src/Lang/isError.php b/src/Lang/isError.php index 0a9598f..70f5186 100644 --- a/src/Lang/isError.php +++ b/src/Lang/isError.php @@ -31,7 +31,7 @@ */ function isError($value): bool { - if (!\is_object($value)) { + if (! \is_object($value)) { return false; } diff --git a/src/ListCache.php b/src/ListCache.php index 0c8931d..18c5b1e 100644 --- a/src/ListCache.php +++ b/src/ListCache.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _; diff --git a/src/Lodash.php b/src/Lodash.php index 08a6e01..d228161 100644 --- a/src/Lodash.php +++ b/src/Lodash.php @@ -14,7 +14,9 @@ final class _ public $__chain__ = false; public const reInterpolate = '<%=([\s\S]+?)%>'; + public const reEvaluate = "<%([\s\S]+?)%>"; + public const reEscape = "<%-([\s\S]+?)%>"; public static $templateSettings = [ @@ -54,19 +56,16 @@ public function __construct($value) } /** - * @param string $method - * @param array $args - * * @return mixed * @throws Exception */ public static function __callStatic(string $method, array $args) { - if (!\is_callable("_\\$method")) { - throw new \InvalidArgumentException("Function _::$method is not valid"); + if (! \is_callable("_\\{$method}")) { + throw new \InvalidArgumentException("Function _::{$method} is not valid"); } - return ("_\\$method")(...$args); + return ("_\\{$method}")(...$args); } public function __call($method, $arguments) @@ -89,13 +88,13 @@ function lodash($value): _ // We can't use "_" as a function name, since it collides with the "_" function in the gettext extension // Laravel uses a function __, so only register the alias if the function name is not in use -if (!function_exists('__')) { +if (! function_exists('__')) { function __($value): _ { return new _($value); } } -if (!defined('_')) { +if (! defined('_')) { define('_', _::class); } diff --git a/src/MapCache.php b/src/MapCache.php index 7726fad..b7b7e14 100644 --- a/src/MapCache.php +++ b/src/MapCache.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _; @@ -57,9 +57,9 @@ final public function clear() { $this->size = 0; $this->__data__ = [ - 'hash' => new Hash, - 'map' => new ListCache, - 'string' => new Hash, + 'hash' => new Hash(), + 'map' => new ListCache(), + 'string' => new Hash(), ]; } diff --git a/src/Math/add.php b/src/Math/add.php index 5d53cb4..780f0a2 100644 --- a/src/Math/add.php +++ b/src/Math/add.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _; diff --git a/src/Math/max.php b/src/Math/max.php index bc61451..ecec06c 100644 --- a/src/Math/max.php +++ b/src/Math/max.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _; diff --git a/src/Math/maxBy.php b/src/Math/maxBy.php index 3127605..06abab0 100644 --- a/src/Math/maxBy.php +++ b/src/Math/maxBy.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _; diff --git a/src/Object/get.php b/src/Object/get.php index 3a0c66d..9449ad1 100644 --- a/src/Object/get.php +++ b/src/Object/get.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2019 + * @copyright Copyright (c) 2017 */ namespace _; diff --git a/src/Object/pick.php b/src/Object/pick.php index 9813514..5672c01 100644 --- a/src/Object/pick.php +++ b/src/Object/pick.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _; diff --git a/src/Object/pickBy.php b/src/Object/pickBy.php index 7d85cc0..1d44e48 100644 --- a/src/Object/pickBy.php +++ b/src/Object/pickBy.php @@ -36,7 +36,7 @@ function pickBy($object, callable $predicate): \stdClass { if (null === $object) { - return new \stdClass; + return new \stdClass(); } $props = arrayMap(\array_keys(\get_object_vars($object)), function ($prop) { diff --git a/src/String/camelCase.php b/src/String/camelCase.php index e669e5a..487e7ec 100644 --- a/src/String/camelCase.php +++ b/src/String/camelCase.php @@ -35,6 +35,6 @@ function camelCase(string $string): string { return \lcfirst(\array_reduce(words(\preg_replace("/['\\x{2019}]/u", '', $string)), function ($result, $word) { - return $result.capitalize(\strtolower($word)); + return $result . capitalize(\strtolower($word)); }, '')); } diff --git a/src/String/deburr.php b/src/String/deburr.php index a850d78..c9e04b6 100644 --- a/src/String/deburr.php +++ b/src/String/deburr.php @@ -76,11 +76,11 @@ const rsComboMarksRange = '\\x{0300}-\\x{036f}'; const reComboHalfMarksRange = '\\x{fe20}-\\x{fe2f}'; const rsComboSymbolsRange = '\\x{20d0}-\\x{20ff}'; -const rsComboRange = rsComboMarksRange.reComboHalfMarksRange.rsComboSymbolsRange; +const rsComboRange = rsComboMarksRange . reComboHalfMarksRange . rsComboSymbolsRange; /** Used to compose unicode capture groups to match [combining diacritical marks](https =>//en.wikipedia.org/wiki/Combining_Diacritical_Marks) and * [combining diacritical marks for symbols](https =>//en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). */ -const rsCombo = '#['.rsComboRange.']#u'; +const rsCombo = '#[' . rsComboRange . ']#u'; /** * Deburrs `string` by converting @@ -105,7 +105,7 @@ function deburr(string $string): string { $patterns = \array_map( function ($pattern) { - return "#$pattern#u"; + return "#{$pattern}#u"; }, \array_keys(deburredLetters) ); diff --git a/src/String/escape.php b/src/String/escape.php index 680ca98..be6f65a 100644 --- a/src/String/escape.php +++ b/src/String/escape.php @@ -15,7 +15,6 @@ * Converts the characters "&", "<", ">", '"', and "'" in `string` to their * corresponding HTML entities. * - * * Though the ">" character is escaped for symmetry, characters like * ">" and "/" don't need escaping in HTML and have no special meaning * unless they're part of a tag or unquoted attribute value. See diff --git a/src/String/replace.php b/src/String/replace.php index 9e308f6..8ec67a8 100644 --- a/src/String/replace.php +++ b/src/String/replace.php @@ -34,7 +34,7 @@ function replace(string $string, string $pattern, $replacement = null): string { $callback = function (array $matches) use ($replacement): ?string { - if (!\array_filter($matches)) { + if (! \array_filter($matches)) { return null; } @@ -42,7 +42,7 @@ function replace(string $string, string $pattern, $replacement = null): string }; if (\preg_match(reRegExpChar, $pattern)) { - if (!\is_callable($replacement)) { + if (! \is_callable($replacement)) { return \preg_replace($pattern, \is_string($replacement) || \is_array($replacement) ? $replacement : '', $string); } diff --git a/src/String/template.php b/src/String/template.php index 559e2b4..de6911d 100644 --- a/src/String/template.php +++ b/src/String/template.php @@ -106,13 +106,13 @@ function template(string $string, array $options = []): callable ($options['evaluate'] ?? reNoMatch), ]); - $string = \preg_replace_callback('#'.$reDelimiters.'#u', function ($matches) { + $string = \preg_replace_callback('#' . $reDelimiters . '#u', function ($matches) { list(, $escapeValue, $interpolateValue, $esTemplateValue, $evaluateValue, - ) = \array_merge($matches, \array_fill(\count($matches), 5 - \count($matches), null)); + ) = \array_merge($matches, \array_fill(\count($matches), 5 - \count($matches), null)); $interpolateValue = $interpolateValue ?: $esTemplateValue; @@ -159,20 +159,20 @@ public function __invoke(array $arguments = []) foreach ($this->imports as $import => $alias) { if (\class_exists($import)) { - $imports .= "use $import as $alias;"; + $imports .= "use {$import} as {$alias};"; } elseif (\function_exists($import)) { - $imports .= "use function $import as $alias;"; + $imports .= "use function {$import} as {$alias};"; } } /** @var string $file */ $file = \tempnam(\sys_get_temp_dir(), 'lodashphp'); - if (!$file) { + if (! $file) { throw new \RuntimeException('Unable to create temporary file for template'); } - \file_put_contents($file, "'.$this->source.''); + \file_put_contents($file, "' . $this->source . ''); $content = attempt(function () use ($file) { \ob_start(); diff --git a/src/String/truncate.php b/src/String/truncate.php index 7fc4601..21d7f1d 100644 --- a/src/String/truncate.php +++ b/src/String/truncate.php @@ -84,7 +84,7 @@ function truncate($string, array $options = []) : \substr($string, 0, $end); if (null === $separator) { - return $result.$omission; + return $result . $omission; } if ($strSymbols) { @@ -110,5 +110,5 @@ function truncate($string, array $options = []) } } - return $result.$omission; + return $result . $omission; } diff --git a/src/Util/defaultTo.php b/src/Util/defaultTo.php index 79b8baf..150a03a 100644 --- a/src/Util/defaultTo.php +++ b/src/Util/defaultTo.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2019 + * @copyright Copyright (c) 2017 */ namespace _; @@ -39,5 +39,5 @@ */ function defaultTo($value, $defaultValue) { - return (null !== $value && (is_object($value) || !\is_nan(\floatval($value)))) ? $value : $defaultValue; + return (null !== $value && (is_object($value) || ! \is_nan(\floatval($value)))) ? $value : $defaultValue; } diff --git a/src/Util/property.php b/src/Util/property.php index 17f75f0..84cab24 100644 --- a/src/Util/property.php +++ b/src/Util/property.php @@ -58,7 +58,7 @@ function property($path): callable } if (\is_string($path) && $path[0] !== '[' && $path[-1] !== ']') { - $path = "[$path]"; + $path = "[{$path}]"; } } diff --git a/src/bootstrap.php b/src/bootstrap.php index 8bc7456..ce39d78 100644 --- a/src/bootstrap.php +++ b/src/bootstrap.php @@ -9,12 +9,12 @@ * @copyright Copyright (c) 2017 */ -if (file_exists($file = __DIR__.'/compiled.php')) { +if (file_exists($file = __DIR__ . '/compiled.php')) { require_once $file; } else { - require_once __DIR__.'/internal/Traits/CacheDataTrait.php'; - require_once __DIR__.'/internal/unicode.php'; - require_once __DIR__.'/CacheInterface.php'; + require_once __DIR__ . '/internal/Traits/CacheDataTrait.php'; + require_once __DIR__ . '/internal/unicode.php'; + require_once __DIR__ . '/CacheInterface.php'; foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__, RecursiveDirectoryIterator::SKIP_DOTS)) as $file) { require_once $file->getRealPath(); diff --git a/src/internal/Traits/CacheDataTrait.php b/src/internal/Traits/CacheDataTrait.php index 4700cce..559a0e0 100644 --- a/src/internal/Traits/CacheDataTrait.php +++ b/src/internal/Traits/CacheDataTrait.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _\internal\Traits; diff --git a/src/internal/arrayMap.php b/src/internal/arrayMap.php index 2a56b5d..8f83dd0 100644 --- a/src/internal/arrayMap.php +++ b/src/internal/arrayMap.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _\internal; diff --git a/src/internal/arrayPush.php b/src/internal/arrayPush.php index a0af2b3..a1afffb 100644 --- a/src/internal/arrayPush.php +++ b/src/internal/arrayPush.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _\internal; diff --git a/src/internal/assocIndexOf.php b/src/internal/assocIndexOf.php index b8cb19a..236d295 100644 --- a/src/internal/assocIndexOf.php +++ b/src/internal/assocIndexOf.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _\internal; diff --git a/src/internal/baseFlatten.php b/src/internal/baseFlatten.php index 61a7a03..aedd177 100644 --- a/src/internal/baseFlatten.php +++ b/src/internal/baseFlatten.php @@ -42,7 +42,7 @@ function baseFlatten(?array $array, int $depth, callable $predicate = null, bool } else { arrayPush($result, $value); } - } elseif (!$isStrict) { + } elseif (! $isStrict) { $result[\count($result)] = $value; } } diff --git a/src/internal/baseGet.php b/src/internal/baseGet.php index a9ff96a..4a2ff5f 100644 --- a/src/internal/baseGet.php +++ b/src/internal/baseGet.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _\internal; @@ -20,9 +20,9 @@ function baseGet($object, $path) $index = 0; $length = \count($path); - while ($object !== null && !is_scalar($object) && $index < $length) { + while ($object !== null && ! is_scalar($object) && $index < $length) { $object = property(toKey($path[$index++]))($object); } - return ($index > 0 && $index === $length) ? $object : null; + return ($index > 0 && $index === $length) ? $object : null; } diff --git a/src/internal/baseIntersection.php b/src/internal/baseIntersection.php index e366d37..4c5072a 100644 --- a/src/internal/baseIntersection.php +++ b/src/internal/baseIntersection.php @@ -22,13 +22,13 @@ function baseIntersection($arrays, ?callable $iteratee, $comparator = null) $result = []; while ($othIndex--) { - $array =& $arrays[$othIndex]; + $array = &$arrays[$othIndex]; if ($othIndex && $iteratee) { $array = \array_map($iteratee, $array); } $maxLength = \min(\count($array), $maxLength); - $caches[$othIndex] = !$comparator && $iteratee ? [] : null; + $caches[$othIndex] = ! $comparator && $iteratee ? [] : null; } $array = $arrays[0]; @@ -41,11 +41,11 @@ function baseIntersection($arrays, ?callable $iteratee, $comparator = null) $computed = $iteratee ? $iteratee($value) : $value; $value = ($comparator ?: $value !== 0) ? $value : 0; - if (!($seen ? \is_scalar($computed) && isset($seen[$computed]) : $includes($result, $computed, $comparator))) { + if (! ($seen ? \is_scalar($computed) && isset($seen[$computed]) : $includes($result, $computed, $comparator))) { $othIndex = $othLength; while (--$othIndex) { $cache = $caches[$othIndex]; - if (!(!empty($cache) ? isset($cache[$computed]) : $includes($arrays[$othIndex], $computed, $comparator))) { + if (! (! empty($cache) ? isset($cache[$computed]) : $includes($arrays[$othIndex], $computed, $comparator))) { continue 2; } } diff --git a/src/internal/baseInvoke.php b/src/internal/baseInvoke.php index 1170f84..78203ee 100644 --- a/src/internal/baseInvoke.php +++ b/src/internal/baseInvoke.php @@ -1,6 +1,11 @@ + * @copyright Copyright (c) 2017 + */ /* * This file is part of the SolidWorx Lodash-PHP project. diff --git a/src/internal/baseMatches.php b/src/internal/baseMatches.php index 3f39f4f..bc3ac9f 100644 --- a/src/internal/baseMatches.php +++ b/src/internal/baseMatches.php @@ -23,7 +23,7 @@ function baseMatches($source): callable if (\is_iterable($source)) { foreach ($source as $k => $v) { - if (!isEqual(property($k)($value, $index, $collection), $v)) { + if (! isEqual(property($k)($value, $index, $collection), $v)) { return false; } } diff --git a/src/internal/baseOrderBy.php b/src/internal/baseOrderBy.php index d8c2d89..59c17f3 100644 --- a/src/internal/baseOrderBy.php +++ b/src/internal/baseOrderBy.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _\internal; diff --git a/src/internal/basePick.php b/src/internal/basePick.php index 477ab46..4cb0672 100644 --- a/src/internal/basePick.php +++ b/src/internal/basePick.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _\internal; @@ -14,6 +14,6 @@ function basePick($object, $paths): \stdClass { return basePickBy($object, $paths, function ($value, $path) use ($object) { - return property_exists($object, $path) || method_exists($object, 'get'.(ucfirst($path))); + return property_exists($object, $path) || method_exists($object, 'get' . (ucfirst($path))); }); } diff --git a/src/internal/basePickBy.php b/src/internal/basePickBy.php index 3176a70..2a73d90 100644 --- a/src/internal/basePickBy.php +++ b/src/internal/basePickBy.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _\internal; diff --git a/src/internal/baseReduce.php b/src/internal/baseReduce.php index 9d0f360..50178c0 100644 --- a/src/internal/baseReduce.php +++ b/src/internal/baseReduce.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _\internal; diff --git a/src/internal/baseRest.php b/src/internal/baseRest.php index 95094d0..7c28baa 100644 --- a/src/internal/baseRest.php +++ b/src/internal/baseRest.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _\internal; diff --git a/src/internal/baseSet.php b/src/internal/baseSet.php index 204a908..9856809 100644 --- a/src/internal/baseSet.php +++ b/src/internal/baseSet.php @@ -6,14 +6,14 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _\internal; function baseSet($object, $path, $value, callable $customizer = null) { - if (!\is_object($object)) { + if (! \is_object($object)) { return $object; } @@ -28,7 +28,7 @@ function baseSet($object, $path, $value, callable $customizer = null) $key = toKey($path[$index]); if ($index !== $lastIndex) { - $objValue = \is_array($nested) ? ($nested[$key] ?? null) : ($nested->$key ?? null); + $objValue = \is_array($nested) ? ($nested[$key] ?? null) : ($nested->{$key} ?? null); $newValue = $customizer ? $customizer($objValue, $key, $nested) : $objValue; if (null === $newValue) { $newValue = \is_object($objValue) ? $objValue : (\is_numeric($path[$index + 1]) ? [] : new \stdClass()); @@ -43,7 +43,7 @@ function baseSet($object, $path, $value, callable $customizer = null) if (\is_array($nested)) { $nested = &$nested[$key]; } else { - $nested = &$nested->$key; + $nested = &$nested->{$key}; } continue; diff --git a/src/internal/baseTimes.php b/src/internal/baseTimes.php index cfc60b6..5246bc3 100644 --- a/src/internal/baseTimes.php +++ b/src/internal/baseTimes.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _\internal; diff --git a/src/internal/baseUnary.php b/src/internal/baseUnary.php index ddfbf80..67b75af 100644 --- a/src/internal/baseUnary.php +++ b/src/internal/baseUnary.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _\internal; diff --git a/src/internal/baseUniq.php b/src/internal/baseUniq.php index 1445b74..e6ae8cb 100644 --- a/src/internal/baseUniq.php +++ b/src/internal/baseUniq.php @@ -2,6 +2,13 @@ declare(strict_types=1); +/* + * This file is part of the SolidWorx Lodash-PHP project. + * + * @author Pierre du Plessis + * @copyright Copyright (c) 2017 + */ + namespace _\internal; /* @@ -45,7 +52,7 @@ function baseUniq(array $array, callable $iteratee = null, callable $comparator } $result[] = $value; - } elseif (!$includes($result, $computed, $comparator)) { + } elseif (! $includes($result, $computed, $comparator)) { if ($seen !== $result) { $seen[] = $computed; } diff --git a/src/internal/castPath.php b/src/internal/castPath.php index 6c2ea8e..08beed5 100644 --- a/src/internal/castPath.php +++ b/src/internal/castPath.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _\internal; diff --git a/src/internal/castSlice.php b/src/internal/castSlice.php index 6d50495..1fe9f26 100644 --- a/src/internal/castSlice.php +++ b/src/internal/castSlice.php @@ -27,5 +27,5 @@ function castSlice(array $array, int $start, ?int $end = null): array $length = \count($array); $end = $end ?? $length; - return (!$start && $end >= $length) ? $array : \array_slice($array, $start, $end); + return (! $start && $end >= $length) ? $array : \array_slice($array, $start, $end); } diff --git a/src/internal/compareMultiple.php b/src/internal/compareMultiple.php index ec345de..f15c2db 100644 --- a/src/internal/compareMultiple.php +++ b/src/internal/compareMultiple.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _\internal; diff --git a/src/internal/createAggregator.php b/src/internal/createAggregator.php index ea63c5a..20b895c 100644 --- a/src/internal/createAggregator.php +++ b/src/internal/createAggregator.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _\internal; diff --git a/src/internal/createMathOperation.php b/src/internal/createMathOperation.php index 7f4fcf0..d28c081 100644 --- a/src/internal/createMathOperation.php +++ b/src/internal/createMathOperation.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _\internal; diff --git a/src/internal/flatRest.php b/src/internal/flatRest.php index 0cee4a8..8c656ca 100644 --- a/src/internal/flatRest.php +++ b/src/internal/flatRest.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _\internal; diff --git a/src/internal/hasUnicode.php b/src/internal/hasUnicode.php index 117866e..56bc0bb 100644 --- a/src/internal/hasUnicode.php +++ b/src/internal/hasUnicode.php @@ -12,7 +12,7 @@ namespace _\internal; /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ -const reHasUnicode = '['.rsZWJ.rsAstralRange.rsComboRange.rsVarRange.']'; +const reHasUnicode = '[' . rsZWJ . rsAstralRange . rsComboRange . rsVarRange . ']'; /** * Checks if `string` contains Unicode symbols. @@ -25,5 +25,5 @@ */ function hasUnicode(string $string): bool { - return \preg_match('#'.reHasUnicode.'#u', $string) > 0; + return \preg_match('#' . reHasUnicode . '#u', $string) > 0; } diff --git a/src/internal/isIterateeCall.php b/src/internal/isIterateeCall.php index 08b13b2..b3401bd 100644 --- a/src/internal/isIterateeCall.php +++ b/src/internal/isIterateeCall.php @@ -24,7 +24,7 @@ */ function isIterateeCall($value, $index = null, $object = null) { - if (!\is_object($object) || !\is_array($object)) { + if (! \is_object($object) || ! \is_array($object)) { return false; } diff --git a/src/internal/isKey.php b/src/internal/isKey.php index bb0ce5b..797ba2a 100644 --- a/src/internal/isKey.php +++ b/src/internal/isKey.php @@ -33,5 +33,5 @@ function isKey($value, $object = []): bool return true; } - return \preg_match(reIsPlainProp, $value) || !\preg_match(reIsDeepProp, $value) || (null !== $object && isset(((object) $object)->$value)); + return \preg_match(reIsPlainProp, $value) || ! \preg_match(reIsDeepProp, $value) || (null !== $object && isset(((object) $object)->{$value})); } diff --git a/src/internal/memoizeCapped.php b/src/internal/memoizeCapped.php index 0eb18d0..fec2a7c 100644 --- a/src/internal/memoizeCapped.php +++ b/src/internal/memoizeCapped.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _\internal; diff --git a/src/internal/overRest.php b/src/internal/overRest.php index a17be23..9616a67 100644 --- a/src/internal/overRest.php +++ b/src/internal/overRest.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _\internal; diff --git a/src/internal/parent.php b/src/internal/parent.php index 49b3d78..e783070 100644 --- a/src/internal/parent.php +++ b/src/internal/parent.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _\internal; diff --git a/src/internal/shortOut.php b/src/internal/shortOut.php index 826ac6b..8cb43ce 100644 --- a/src/internal/shortOut.php +++ b/src/internal/shortOut.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _\internal; diff --git a/src/internal/stringToPath.php b/src/internal/stringToPath.php index d2d8b39..7ce2014 100644 --- a/src/internal/stringToPath.php +++ b/src/internal/stringToPath.php @@ -6,7 +6,7 @@ * This file is part of the SolidWorx Lodash-PHP project. * * @author Pierre du Plessis - * @copyright Copyright (c) 2018 + * @copyright Copyright (c) 2017 */ namespace _\internal; diff --git a/src/internal/unicode.php b/src/internal/unicode.php index dd371ba..2bd6772 100644 --- a/src/internal/unicode.php +++ b/src/internal/unicode.php @@ -15,7 +15,7 @@ const rsComboMarksRange = '\\x{0300}-\\x{036f}'; const reComboHalfMarksRange = '\\x{fe20}-\\x{fe2f}'; const rsComboSymbolsRange = '\\x{20d0}-\\x{20ff}'; -const rsComboRange = rsComboMarksRange.reComboHalfMarksRange.rsComboSymbolsRange; +const rsComboRange = rsComboMarksRange . reComboHalfMarksRange . rsComboSymbolsRange; const rsDingbatRange = '\\x{2700}-\\x{27bf}'; const rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff'; const rsMathOpRange = '\\xac\\xb1\\xd7\\xf7'; @@ -24,40 +24,40 @@ const rsSpaceRange = ' \\t\\x0b\\f\\xa0\\x{feff}\\n\\r\\x{2028}\\x{2029}\\x{1680}\\x{180e}\\x{2000}\\x{2001}\\x{2002}\\x{2003}\\x{2004}\\x{2005}\\x{2006}\\x{2007}\\x{2008}\\x{2009}\\x{200a}\\x{202f}\\x{205f}\\x{3000}'; const rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde'; const rsVarRange = '\\x{fe0e}\\x{fe0f}'; -const rsBreakRange = rsMathOpRange.rsNonCharRange.rsPunctuationRange.rsSpaceRange; +const rsBreakRange = rsMathOpRange . rsNonCharRange . rsPunctuationRange . rsSpaceRange; /** Used to compose unicode capture groups. */ -const rsApos = "[\\x{2019}]"; -const rsBreak = '['.rsBreakRange.']'; -const rsCombo = '['.rsComboRange.']'; +const rsApos = '[\\x{2019}]'; +const rsBreak = '[' . rsBreakRange . ']'; +const rsCombo = '[' . rsComboRange . ']'; const rsDigits = '\\d+'; -const rsDingbat = '['.rsDingbatRange.']'; -const rsLower = '['.rsLowerRange.']'; -const rsMisc = '[^'.rsAstralRange.rsBreakRange.rsDigits.rsDingbatRange.rsLowerRange.rsUpperRange.']'; +const rsDingbat = '[' . rsDingbatRange . ']'; +const rsLower = '[' . rsLowerRange . ']'; +const rsMisc = '[^' . rsAstralRange . rsBreakRange . rsDigits . rsDingbatRange . rsLowerRange . rsUpperRange . ']'; const rsFitz = '\\x{e83c}[\\x{effb}-\\x{efff}]'; -const rsModifier = '(?:'.rsCombo.'|'.rsFitz.')'; -const rsNonAstral = '[^'.rsAstralRange.']'; +const rsModifier = '(?:' . rsCombo . '|' . rsFitz . ')'; +const rsNonAstral = '[^' . rsAstralRange . ']'; const rsRegional = '(?:\\x{e83c}[\\x{ede6}-\\x{edff}]){2}'; const rsSurrPair = '[\\x{e800}-\\x{ebff}][\\x{ec00}-\\x{efff}]'; -const rsUpper = '['.rsUpperRange.']'; +const rsUpper = '[' . rsUpperRange . ']'; const rsZWJ = '\\x{200d}'; /** Used to compose unicode regexes. */ -const rsMiscLower = '(?:'.rsLower.'|'.rsMisc.')'; -const rsMiscUpper = '(?:'.rsUpper.'|'.rsMisc.')'; -const rsOptContrLower = '(?:'.rsApos.'(?:d|ll|m|re|s|t|ve))?'; -const rsOptContrUpper = '(?:'.rsApos.'(?:D|LL|M|RE|S|T|VE))?'; -const reOptMod = rsModifier.'?'; -const rsOptVar = '['.rsVarRange.']?'; -define('rsOptJoin', '(?:'.rsZWJ.'(?:'.implode('|', [rsNonAstral, rsRegional, rsSurrPair]).')'.rsOptVar.reOptMod.')*'); +const rsMiscLower = '(?:' . rsLower . '|' . rsMisc . ')'; +const rsMiscUpper = '(?:' . rsUpper . '|' . rsMisc . ')'; +const rsOptContrLower = '(?:' . rsApos . '(?:d|ll|m|re|s|t|ve))?'; +const rsOptContrUpper = '(?:' . rsApos . '(?:D|LL|M|RE|S|T|VE))?'; +const reOptMod = rsModifier . '?'; +const rsOptVar = '[' . rsVarRange . ']?'; +define('rsOptJoin', '(?:' . rsZWJ . '(?:' . implode('|', [rsNonAstral, rsRegional, rsSurrPair]) . ')' . rsOptVar . reOptMod . ')*'); const rsOrdLower = '\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)'; const rsOrdUpper = '\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)'; -const rsSeq = rsOptVar.reOptMod.rsOptJoin; -define('rsEmoji', '(?:'.implode('|', [rsDingbat, rsRegional, rsSurrPair]).')'.rsSeq); +const rsSeq = rsOptVar . reOptMod . rsOptJoin; +define('rsEmoji', '(?:' . implode('|', [rsDingbat, rsRegional, rsSurrPair]) . ')' . rsSeq); -const rsAstral = '['.rsAstralRange.']'; -const rsNonAstralCombo = rsNonAstral.rsCombo.'?'; -define('rsSymbol', '(?:'.implode('|', [rsNonAstralCombo, rsCombo, rsRegional, rsSurrPair, rsAstral]).')'); +const rsAstral = '[' . rsAstralRange . ']'; +const rsNonAstralCombo = rsNonAstral . rsCombo . '?'; +define('rsSymbol', '(?:' . implode('|', [rsNonAstralCombo, rsCombo, rsRegional, rsSurrPair, rsAstral]) . ')'); /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ -const reUnicode = rsFitz.'(?='.rsFitz.')|'.rsSymbol.rsSeq; +const reUnicode = rsFitz . '(?=' . rsFitz . ')|' . rsSymbol . rsSeq; diff --git a/src/internal/unicodeToArray.php b/src/internal/unicodeToArray.php index b63030f..b7fac8f 100644 --- a/src/internal/unicodeToArray.php +++ b/src/internal/unicodeToArray.php @@ -22,7 +22,7 @@ */ function unicodeToArray(string $string): array { - if (\preg_match_all('#'.reUnicode.'#u', $string, $matches)) { + if (\preg_match_all('#' . reUnicode . '#u', $string, $matches)) { return $matches[0]; } diff --git a/src/internal/unicodeWords.php b/src/internal/unicodeWords.php index 9f2a0c3..59bcce2 100644 --- a/src/internal/unicodeWords.php +++ b/src/internal/unicodeWords.php @@ -22,16 +22,16 @@ */ function unicodeWords(string $string): array { - $regex = '#'.\implode('|', [ - rsUpper.'?'.rsLower.'+'.rsOptContrLower.'(?='.\implode('|', [rsBreak, rsUpper, '$']).')', - rsMiscUpper.'+'.rsOptContrUpper.'(?='.\implode('|', [rsBreak, rsUpper.rsMiscLower, '$']).')', - rsUpper.'?'.rsMiscLower.'+'.rsOptContrLower, - rsUpper.'+'.rsOptContrUpper, + $regex = '#' . \implode('|', [ + rsUpper . '?' . rsLower . '+' . rsOptContrLower . '(?=' . \implode('|', [rsBreak, rsUpper, '$']) . ')', + rsMiscUpper . '+' . rsOptContrUpper . '(?=' . \implode('|', [rsBreak, rsUpper . rsMiscLower, '$']) . ')', + rsUpper . '?' . rsMiscLower . '+' . rsOptContrLower, + rsUpper . '+' . rsOptContrUpper, rsOrdUpper, rsOrdLower, rsDigits, rsEmoji, - ]).'#u'; + ]) . '#u'; if (\preg_match_all($regex, $string, $matches) > 0) { return $matches[0]; diff --git a/tests/Array/DropWhileTest.php b/tests/Array/DropWhileTest.php index 50bef5a..a0df88f 100644 --- a/tests/Array/DropWhileTest.php +++ b/tests/Array/DropWhileTest.php @@ -25,7 +25,7 @@ public function testDropWhile() $this->assertSame([['user' => 'pebbles', 'active' => false]], dropWhile($users, function ($user) { return $user['active']; })); - + $lines = [ 'Processing report:', 'Processed: 1', diff --git a/tests/Array/FlattenDeepTest.php b/tests/Array/FlattenDeepTest.php index 028529d..6d75e74 100644 --- a/tests/Array/FlattenDeepTest.php +++ b/tests/Array/FlattenDeepTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\flattenDeep; use PHPUnit\Framework\TestCase; +use function _\flattenDeep; class FlattenDeepTest extends TestCase { diff --git a/tests/Array/FlattenDepthTest.php b/tests/Array/FlattenDepthTest.php index d796d64..cea1eb6 100644 --- a/tests/Array/FlattenDepthTest.php +++ b/tests/Array/FlattenDepthTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\flattenDepth; use PHPUnit\Framework\TestCase; +use function _\flattenDepth; class FlattenDepthTest extends TestCase { diff --git a/tests/Array/FlattenTest.php b/tests/Array/FlattenTest.php index 3c28d78..2de1922 100644 --- a/tests/Array/FlattenTest.php +++ b/tests/Array/FlattenTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\flatten; use PHPUnit\Framework\TestCase; +use function _\flatten; class FlattenTest extends TestCase { diff --git a/tests/Array/HeadTest.php b/tests/Array/HeadTest.php index 6e6a54c..98887e6 100644 --- a/tests/Array/HeadTest.php +++ b/tests/Array/HeadTest.php @@ -9,9 +9,9 @@ * @copyright Copyright (c) 2017 */ +use PHPUnit\Framework\TestCase; use function _\first; use function _\head; -use PHPUnit\Framework\TestCase; class HeadTest extends TestCase { diff --git a/tests/Array/InitialTest.php b/tests/Array/InitialTest.php index 8aec608..4d60d28 100644 --- a/tests/Array/InitialTest.php +++ b/tests/Array/InitialTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\initial; use PHPUnit\Framework\TestCase; +use function _\initial; class InitialTest extends TestCase { diff --git a/tests/Array/IntersectionTest.php b/tests/Array/IntersectionTest.php index f8a9448..f92ea05 100644 --- a/tests/Array/IntersectionTest.php +++ b/tests/Array/IntersectionTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\intersection; use PHPUnit\Framework\TestCase; +use function _\intersection; class IntersectionTest extends TestCase { diff --git a/tests/Array/LastIndexOfTest.php b/tests/Array/LastIndexOfTest.php index 56da38a..b0a7c57 100644 --- a/tests/Array/LastIndexOfTest.php +++ b/tests/Array/LastIndexOfTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\lastIndexOf; use PHPUnit\Framework\TestCase; +use function _\lastIndexOf; class LastIndexOfTest extends TestCase { diff --git a/tests/Array/LastTest.php b/tests/Array/LastTest.php index e41aa93..29dd849 100644 --- a/tests/Array/LastTest.php +++ b/tests/Array/LastTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\last; use PHPUnit\Framework\TestCase; +use function _\last; class LastTest extends TestCase { diff --git a/tests/Array/NthTest.php b/tests/Array/NthTest.php index 725f0d2..f7d2759 100644 --- a/tests/Array/NthTest.php +++ b/tests/Array/NthTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\nth; use PHPUnit\Framework\TestCase; +use function _\nth; class NthTest extends TestCase { diff --git a/tests/Array/PullAllByTest.php b/tests/Array/PullAllByTest.php index 6682e3b..73e5206 100644 --- a/tests/Array/PullAllByTest.php +++ b/tests/Array/PullAllByTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\pullAllBy; use PHPUnit\Framework\TestCase; +use function _\pullAllBy; class PullAllByTest extends TestCase { diff --git a/tests/Array/PullAllTest.php b/tests/Array/PullAllTest.php index 34aab23..544aa26 100644 --- a/tests/Array/PullAllTest.php +++ b/tests/Array/PullAllTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\pullAll; use PHPUnit\Framework\TestCase; +use function _\pullAll; class PullAllTest extends TestCase { diff --git a/tests/Array/PullTest.php b/tests/Array/PullTest.php index c3bda88..854e185 100644 --- a/tests/Array/PullTest.php +++ b/tests/Array/PullTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\pull; use PHPUnit\Framework\TestCase; +use function _\pull; class PullTest extends TestCase { diff --git a/tests/Array/SliceTest.php b/tests/Array/SliceTest.php index 0272dc1..1d049eb 100644 --- a/tests/Array/SliceTest.php +++ b/tests/Array/SliceTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\slice; use PHPUnit\Framework\TestCase; +use function _\slice; class SliceTest extends TestCase { diff --git a/tests/Array/TailTest.php b/tests/Array/TailTest.php index 13da9de..365b982 100644 --- a/tests/Array/TailTest.php +++ b/tests/Array/TailTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\tail; use PHPUnit\Framework\TestCase; +use function _\tail; class TailTest extends TestCase { diff --git a/tests/Array/UnionByTest.php b/tests/Array/UnionByTest.php index 0dff8c9..837c505 100644 --- a/tests/Array/UnionByTest.php +++ b/tests/Array/UnionByTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\unionBy; use PHPUnit\Framework\TestCase; +use function _\unionBy; class UnionByTest extends TestCase { diff --git a/tests/Array/UnionTest.php b/tests/Array/UnionTest.php index 2d0a80b..346c797 100644 --- a/tests/Array/UnionTest.php +++ b/tests/Array/UnionTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\union; use PHPUnit\Framework\TestCase; +use function _\union; class UnionTest extends TestCase { diff --git a/tests/Array/UniqByTest.php b/tests/Array/UniqByTest.php index 7ee23b4..56aa81c 100644 --- a/tests/Array/UniqByTest.php +++ b/tests/Array/UniqByTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\uniqBy; use PHPUnit\Framework\TestCase; +use function _\uniqBy; class UniqByTest extends TestCase { diff --git a/tests/Array/UniqTest.php b/tests/Array/UniqTest.php index da47eca..ec70944 100644 --- a/tests/Array/UniqTest.php +++ b/tests/Array/UniqTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\uniq; use PHPUnit\Framework\TestCase; +use function _\uniq; class UniqTest extends TestCase { diff --git a/tests/Array/UnzipWithTest.php b/tests/Array/UnzipWithTest.php index 512f1dc..2e9d3d3 100644 --- a/tests/Array/UnzipWithTest.php +++ b/tests/Array/UnzipWithTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\unzipWith; use PHPUnit\Framework\TestCase; +use function _\unzipWith; class UnzipWithTest extends TestCase { diff --git a/tests/Array/ZipObjectTest.php b/tests/Array/ZipObjectTest.php index b4ac506..4dba4ce 100644 --- a/tests/Array/ZipObjectTest.php +++ b/tests/Array/ZipObjectTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\zipObject; use PHPUnit\Framework\TestCase; +use function _\zipObject; class ZipObjectTest extends TestCase { diff --git a/tests/Array/ZipWithTest.php b/tests/Array/ZipWithTest.php index a3a06f3..b4b933c 100644 --- a/tests/Array/ZipWithTest.php +++ b/tests/Array/ZipWithTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\zipWith; use PHPUnit\Framework\TestCase; +use function _\zipWith; class ZipWithTest extends TestCase { diff --git a/tests/Collection/CountByTest.php b/tests/Collection/CountByTest.php index 0f7d329..999d187 100644 --- a/tests/Collection/CountByTest.php +++ b/tests/Collection/CountByTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\countBy; use PHPUnit\Framework\TestCase; +use function _\countBy; class CountByTest extends TestCase { diff --git a/tests/Collection/EachRightTest.php b/tests/Collection/EachRightTest.php index ee68693..6115266 100644 --- a/tests/Collection/EachRightTest.php +++ b/tests/Collection/EachRightTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\eachRight; use PHPUnit\Framework\TestCase; +use function _\eachRight; class EachRightTest extends TestCase { diff --git a/tests/Collection/FilterTest.php b/tests/Collection/FilterTest.php index 0adcc8c..9a0eb27 100644 --- a/tests/Collection/FilterTest.php +++ b/tests/Collection/FilterTest.php @@ -22,7 +22,7 @@ public function testFilter() ]; $this->assertSame([['user' => 'fred', 'age' => 40, 'active' => false]], filter($users, function ($o) { - return !$o['active']; + return ! $o['active']; })); // The `matches` iteratee shorthand. diff --git a/tests/Collection/FlatMapDepthTest.php b/tests/Collection/FlatMapDepthTest.php index 0cfea01..8dbd3c2 100644 --- a/tests/Collection/FlatMapDepthTest.php +++ b/tests/Collection/FlatMapDepthTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\flatMapDepth; use PHPUnit\Framework\TestCase; +use function _\flatMapDepth; class FlatMapDepthTest extends TestCase { diff --git a/tests/Collection/InvokeMapTest.php b/tests/Collection/InvokeMapTest.php index d1e4e11..4978845 100644 --- a/tests/Collection/InvokeMapTest.php +++ b/tests/Collection/InvokeMapTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\invokeMap; use PHPUnit\Framework\TestCase; +use function _\invokeMap; class InvokeMapTest extends TestCase { diff --git a/tests/Collection/ReduceTest.php b/tests/Collection/ReduceTest.php index 75e38e9..276fd73 100644 --- a/tests/Collection/ReduceTest.php +++ b/tests/Collection/ReduceTest.php @@ -20,7 +20,7 @@ public function testReduce() return $sum + $n; }, 0)); $this->assertSame(['1' => ['a', 'c'], '2' => ['b']], reduce(['a' => 1, 'b' => 2, 'c' => 1], function ($result, $value, $key) { - if (!isset($result[$value])) { + if (! isset($result[$value])) { $result[$value] = []; } $result[$value][] = $key; diff --git a/tests/Collection/SampleTest.php b/tests/Collection/SampleTest.php index 3730214..4c10305 100644 --- a/tests/Collection/SampleTest.php +++ b/tests/Collection/SampleTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\sample; use PHPUnit\Framework\TestCase; +use function _\sample; class SampleTest extends TestCase { diff --git a/tests/Collection/ShuffleTest.php b/tests/Collection/ShuffleTest.php index 76e48c7..3aa8758 100644 --- a/tests/Collection/ShuffleTest.php +++ b/tests/Collection/ShuffleTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\shuffle; use PHPUnit\Framework\TestCase; +use function _\shuffle; class ShuffleTest extends TestCase { diff --git a/tests/Collection/SizeTest.php b/tests/Collection/SizeTest.php index b750e29..27ced0c 100644 --- a/tests/Collection/SizeTest.php +++ b/tests/Collection/SizeTest.php @@ -17,7 +17,7 @@ class SizeTest extends TestCase public function testSize() { $this->assertSame(3, size([1, 2, 3])); - $this->assertSame(2, size(new class { + $this->assertSame(2, size(new class() { public $a = 1; public $b = 2; @@ -25,7 +25,7 @@ public function testSize() private $c = 3; })); - $this->assertSame(12, size(new class implements \Countable { + $this->assertSame(12, size(new class() implements \Countable { #[\ReturnTypeWillChange] public function count() { diff --git a/tests/Date/NowTest.php b/tests/Date/NowTest.php index 3307998..ab788f9 100644 --- a/tests/Date/NowTest.php +++ b/tests/Date/NowTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\now; use PHPUnit\Framework\TestCase; +use function _\now; class NowTest extends TestCase { diff --git a/tests/Function/AfterTest.php b/tests/Function/AfterTest.php index ed0c6bc..ded0050 100644 --- a/tests/Function/AfterTest.php +++ b/tests/Function/AfterTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\after; use PHPUnit\Framework\TestCase; +use function _\after; class AfterTest extends TestCase { diff --git a/tests/Function/AryTest.php b/tests/Function/AryTest.php index ef9ca60..eb50fa9 100644 --- a/tests/Function/AryTest.php +++ b/tests/Function/AryTest.php @@ -9,9 +9,9 @@ * @copyright Copyright (c) 2017 */ +use PHPUnit\Framework\TestCase; use function _\ary; use function _\map; -use PHPUnit\Framework\TestCase; class AryTest extends TestCase { diff --git a/tests/Function/BeforeTest.php b/tests/Function/BeforeTest.php index f43a968..1f0418e 100644 --- a/tests/Function/BeforeTest.php +++ b/tests/Function/BeforeTest.php @@ -9,10 +9,10 @@ * @copyright Copyright (c) 2017 */ +use PHPUnit\Framework\TestCase; use function _\before; use function _\map; use function _\uniqBy; -use PHPUnit\Framework\TestCase; class BeforeTest extends TestCase { @@ -42,6 +42,6 @@ public function testBeforeMap() ]; })), 'id'); - $this->assertSame([['id' => 1],['id' => 2],['id' => 3],['id' => 4]], $result); + $this->assertSame([['id' => 1], ['id' => 2], ['id' => 3], ['id' => 4]], $result); } } diff --git a/tests/Function/BindKeyTest.php b/tests/Function/BindKeyTest.php index 7cfcc50..f1d643c 100644 --- a/tests/Function/BindKeyTest.php +++ b/tests/Function/BindKeyTest.php @@ -16,12 +16,12 @@ class BindKeyTest extends TestCase { public function testBindKey() { - $object = new class { + $object = new class() { private $user = 'fred'; public function greet($greeting, $punctuation) { - return $greeting.' '.$this->user.$punctuation; + return $greeting . ' ' . $this->user . $punctuation; } }; diff --git a/tests/Function/BindTest.php b/tests/Function/BindTest.php index a99a4f9..7556f5c 100644 --- a/tests/Function/BindTest.php +++ b/tests/Function/BindTest.php @@ -16,14 +16,14 @@ class BindTest extends TestCase { public function testBind() { - $object = new class { + $object = new class() { public $user = 'fred'; private $age = 54; }; $greet = function ($greeting, $punctuation) { - return $greeting.' '.$this->user.$punctuation; + return $greeting . ' ' . $this->user . $punctuation; }; $bound = bind($greet, $object, 'hi'); @@ -31,7 +31,7 @@ public function testBind() $this->assertSame('hi fred!', $bound('!')); $bound = bind(function ($prefix, $suffix) { - return $prefix.' '.$this->age.' '.$suffix; + return $prefix . ' ' . $this->age . ' ' . $suffix; }, $object, 'I\'m'); $this->assertSame('I\'m 54 years', $bound('years')); diff --git a/tests/Function/DelayTest.php b/tests/Function/DelayTest.php index 65e1465..81e805a 100644 --- a/tests/Function/DelayTest.php +++ b/tests/Function/DelayTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\delay; use PHPUnit\Framework\TestCase; +use function _\delay; class DelayTest extends TestCase { diff --git a/tests/Function/PartialTest.php b/tests/Function/PartialTest.php index 2a2c8c1..8a315fc 100644 --- a/tests/Function/PartialTest.php +++ b/tests/Function/PartialTest.php @@ -17,7 +17,7 @@ class PartialTest extends TestCase public function testPartial() { $greet = function ($greeting, $name) { - return $greeting.' '.$name; + return $greeting . ' ' . $name; }; $sayHelloTo = partial($greet, 'hello'); diff --git a/tests/Function/RestTest.php b/tests/Function/RestTest.php index 58ad8d0..fd7abff 100644 --- a/tests/Function/RestTest.php +++ b/tests/Function/RestTest.php @@ -20,8 +20,8 @@ class RestTest extends TestCase public function testRest() { $say = rest(function ($what, $names) { - return $what.' '.implode(', ', initial($names)). - (size($names) > 1 ? ', & ' : '').last($names); + return $what . ' ' . implode(', ', initial($names)) . + (size($names) > 1 ? ', & ' : '') . last($names); }); $this->assertSame('hello fred, barney, & pebbles', $say('hello', 'fred', 'barney', 'pebbles')); diff --git a/tests/Function/SpreadTest.php b/tests/Function/SpreadTest.php index b7b6cdb..423a490 100644 --- a/tests/Function/SpreadTest.php +++ b/tests/Function/SpreadTest.php @@ -17,7 +17,7 @@ class SpreadTest extends TestCase public function testSpread() { $say = spread(function ($who, $what) { - return $who.' says '.$what; + return $who . ' says ' . $what; }); $this->assertSame('fred says hello', $say(['fred', 'hello'])); diff --git a/tests/Function/UnaryTest.php b/tests/Function/UnaryTest.php index b68c439..7f1a050 100644 --- a/tests/Function/UnaryTest.php +++ b/tests/Function/UnaryTest.php @@ -9,9 +9,9 @@ * @copyright Copyright (c) 2017 */ +use PHPUnit\Framework\TestCase; use function _\map; use function _\unary; -use PHPUnit\Framework\TestCase; class UnaryTest extends TestCase { diff --git a/tests/Function/WrapTest.php b/tests/Function/WrapTest.php index 008485f..940d4db 100644 --- a/tests/Function/WrapTest.php +++ b/tests/Function/WrapTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\wrap; use PHPUnit\Framework\TestCase; +use function _\wrap; class WrapTest extends TestCase { diff --git a/tests/Lang/IsErrorTest.php b/tests/Lang/IsErrorTest.php index 4d09881..970accc 100644 --- a/tests/Lang/IsErrorTest.php +++ b/tests/Lang/IsErrorTest.php @@ -22,7 +22,7 @@ public function testIsError() $this->assertTrue(isError(new \Exception())); $this->assertTrue(isError(new \InvalidArgumentException())); $this->assertTrue(isError(new \RuntimeException())); - $this->assertTrue(isError(new \SoapFault("Server", ''))); + $this->assertTrue(isError(new \SoapFault('Server', ''))); $this->assertTrue(isError(new \ParseError())); $this->assertTrue(isError(new \ParseError())); $this->assertTrue(isError(new \PDOException())); diff --git a/tests/LodashTest.php b/tests/LodashTest.php index fae6947..8a1bbc2 100644 --- a/tests/LodashTest.php +++ b/tests/LodashTest.php @@ -1,5 +1,12 @@ + * @copyright Copyright (c) 2017 + */ + use PHPUnit\Framework\TestCase; class LodashTest extends TestCase diff --git a/tests/Number/ClampTest.php b/tests/Number/ClampTest.php index a116c7b..323dd09 100644 --- a/tests/Number/ClampTest.php +++ b/tests/Number/ClampTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\clamp; use PHPUnit\Framework\TestCase; +use function _\clamp; class ClampTest extends TestCase { diff --git a/tests/Number/RandomTest.php b/tests/Number/RandomTest.php index 6ad6d00..f619e60 100644 --- a/tests/Number/RandomTest.php +++ b/tests/Number/RandomTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\inRange; use PHPUnit\Framework\TestCase; +use function _\inRange; use function _\random; class RandomTest extends TestCase diff --git a/tests/Object/GetTest.php b/tests/Object/GetTest.php index 4fb02bb..bdf4e30 100644 --- a/tests/Object/GetTest.php +++ b/tests/Object/GetTest.php @@ -1,49 +1,50 @@ - * @copyright Copyright (c) 2019 + * @copyright Copyright (c) 2017 */ -use function _\get; use PHPUnit\Framework\TestCase; +use function _\get; class GetTest extends TestCase { public function testGetArray() { - $actualValue1 = "data"; - $sampleArray = ["key1" => ["key2" => ["key3" => $actualValue1, "key4" => ""]]]; - $defaultValue = "default"; - $this->assertSame($actualValue1, get($sampleArray, "key1.key2.key3", "default"), "Default To method 1 failed"); - $this->assertSame($defaultValue, get($sampleArray, "key2.key2.key3", $defaultValue), "Default To method 2 failed"); - $this->assertSame($actualValue1, get($sampleArray, ["key1","key2","key3"], $defaultValue), "Default To method 3 failed"); - $this->assertSame($defaultValue, get($sampleArray, "key1.key2.key3.key4", $defaultValue), "Default To method 4 failed"); - $this->assertSame($defaultValue, get($sampleArray, "key1.key2.key3.key4", $defaultValue), "Default To method 5 failed"); - $this->assertSame($defaultValue, get($sampleArray, ["key1","key2","key3","key4"], $defaultValue), "Default To method 6 failed"); - $this->assertSame("", get($sampleArray, "key1.key2.key4", $defaultValue), "Default To method 8 failed"); + $actualValue1 = 'data'; + $sampleArray = ['key1' => ['key2' => ['key3' => $actualValue1, 'key4' => '']]]; + $defaultValue = 'default'; + $this->assertSame($actualValue1, get($sampleArray, 'key1.key2.key3', 'default'), 'Default To method 1 failed'); + $this->assertSame($defaultValue, get($sampleArray, 'key2.key2.key3', $defaultValue), 'Default To method 2 failed'); + $this->assertSame($actualValue1, get($sampleArray, ['key1', 'key2', 'key3'], $defaultValue), 'Default To method 3 failed'); + $this->assertSame($defaultValue, get($sampleArray, 'key1.key2.key3.key4', $defaultValue), 'Default To method 4 failed'); + $this->assertSame($defaultValue, get($sampleArray, 'key1.key2.key3.key4', $defaultValue), 'Default To method 5 failed'); + $this->assertSame($defaultValue, get($sampleArray, ['key1', 'key2', 'key3', 'key4'], $defaultValue), 'Default To method 6 failed'); + $this->assertSame('', get($sampleArray, 'key1.key2.key4', $defaultValue), 'Default To method 8 failed'); - $this->assertSame($sampleArray["key1"]["key2"], _::get($sampleArray, "key1.key2", $defaultValue), "Default To method 9 failed"); - $this->assertSame($defaultValue, _::get($sampleArray, "key1.key3", $defaultValue), "Default To method 10 failed"); + $this->assertSame($sampleArray['key1']['key2'], _::get($sampleArray, 'key1.key2', $defaultValue), 'Default To method 9 failed'); + $this->assertSame($defaultValue, _::get($sampleArray, 'key1.key3', $defaultValue), 'Default To method 10 failed'); } public function testDefaultToObject() { - $actualValue1 = "data"; - $sampleArray = (object)["key1" => (object)["key2" => (object)["key3" => $actualValue1, "key4" => ""]]]; - $defaultValue = "default"; - $this->assertSame($actualValue1, get($sampleArray, "key1.key2.key3", $defaultValue), "Default To method object 1 failed"); - $this->assertSame($defaultValue, get($sampleArray, "key2.key2.key3", $defaultValue), "Default To method object 2 failed"); - $this->assertSame($actualValue1, get($sampleArray, ["key1","key2","key3"], $defaultValue), "Default To method object 3 failed"); - $this->assertSame($defaultValue, get($sampleArray, "key1.key2.key3.key4", $defaultValue), "Default To method object 4 failed"); - $this->assertSame($defaultValue, get($sampleArray, "key1.key2.key3.key4", $defaultValue), "Default To method object 5 failed"); - $this->assertSame($defaultValue, get($sampleArray, ["key1","key2","key3","key4"], $defaultValue), "Default To method object 6 failed"); - $this->assertSame("", get($sampleArray, "key1.key2.key4", $defaultValue), "Default To method object 8 failed"); + $actualValue1 = 'data'; + $sampleArray = (object) ['key1' => (object) ['key2' => (object) ['key3' => $actualValue1, 'key4' => '']]]; + $defaultValue = 'default'; + $this->assertSame($actualValue1, get($sampleArray, 'key1.key2.key3', $defaultValue), 'Default To method object 1 failed'); + $this->assertSame($defaultValue, get($sampleArray, 'key2.key2.key3', $defaultValue), 'Default To method object 2 failed'); + $this->assertSame($actualValue1, get($sampleArray, ['key1', 'key2', 'key3'], $defaultValue), 'Default To method object 3 failed'); + $this->assertSame($defaultValue, get($sampleArray, 'key1.key2.key3.key4', $defaultValue), 'Default To method object 4 failed'); + $this->assertSame($defaultValue, get($sampleArray, 'key1.key2.key3.key4', $defaultValue), 'Default To method object 5 failed'); + $this->assertSame($defaultValue, get($sampleArray, ['key1', 'key2', 'key3', 'key4'], $defaultValue), 'Default To method object 6 failed'); + $this->assertSame('', get($sampleArray, 'key1.key2.key4', $defaultValue), 'Default To method object 8 failed'); - $this->assertSame($sampleArray->key1->key2, _::get($sampleArray, "key1.key2", $defaultValue), "Default To method object 9 failed"); - $this->assertSame($defaultValue, _::get($sampleArray, "key1.key3", $defaultValue), "Default To method 10 failed"); + $this->assertSame($sampleArray->key1->key2, _::get($sampleArray, 'key1.key2', $defaultValue), 'Default To method object 9 failed'); + $this->assertSame($defaultValue, _::get($sampleArray, 'key1.key3', $defaultValue), 'Default To method 10 failed'); } } diff --git a/tests/Seq/ChainTest.php b/tests/Seq/ChainTest.php index f647cff..28cf02d 100644 --- a/tests/Seq/ChainTest.php +++ b/tests/Seq/ChainTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\chain; use PHPUnit\Framework\TestCase; +use function _\chain; class ChainTest extends TestCase { diff --git a/tests/String/CamelCaseTest.php b/tests/String/CamelCaseTest.php index cedc95b..4cd7d80 100644 --- a/tests/String/CamelCaseTest.php +++ b/tests/String/CamelCaseTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\camelCase; use PHPUnit\Framework\TestCase; +use function _\camelCase; class CamelCaseTest extends TestCase { diff --git a/tests/String/EscapeRegExpTest.php b/tests/String/EscapeRegExpTest.php index c26c866..3450de6 100644 --- a/tests/String/EscapeRegExpTest.php +++ b/tests/String/EscapeRegExpTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\escapeRegExp; use PHPUnit\Framework\TestCase; +use function _\escapeRegExp; class EscapeRegExpTest extends TestCase { diff --git a/tests/String/KebabCaseTest.php b/tests/String/KebabCaseTest.php index d1b50c5..12cd3e2 100644 --- a/tests/String/KebabCaseTest.php +++ b/tests/String/KebabCaseTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\kebabCase; use PHPUnit\Framework\TestCase; +use function _\kebabCase; class KebabCaseTest extends TestCase { diff --git a/tests/String/PadStartTest.php b/tests/String/PadStartTest.php index c208936..1a51b12 100644 --- a/tests/String/PadStartTest.php +++ b/tests/String/PadStartTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\padStart; use PHPUnit\Framework\TestCase; +use function _\padStart; class PadStartTest extends TestCase { diff --git a/tests/String/StartCaseTest.php b/tests/String/StartCaseTest.php index 7bd7a95..86e3541 100644 --- a/tests/String/StartCaseTest.php +++ b/tests/String/StartCaseTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\startCase; use PHPUnit\Framework\TestCase; +use function _\startCase; class StartCaseTest extends TestCase { diff --git a/tests/String/StartsWithTest.php b/tests/String/StartsWithTest.php index e4c15a3..abefaff 100644 --- a/tests/String/StartsWithTest.php +++ b/tests/String/StartsWithTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\startsWith; use PHPUnit\Framework\TestCase; +use function _\startsWith; class StartsWithTest extends TestCase { diff --git a/tests/String/TrimEndTest.php b/tests/String/TrimEndTest.php index e387e7d..92ee715 100644 --- a/tests/String/TrimEndTest.php +++ b/tests/String/TrimEndTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\trimEnd; use PHPUnit\Framework\TestCase; +use function _\trimEnd; class TrimEndTest extends TestCase { diff --git a/tests/String/TrimStartTest.php b/tests/String/TrimStartTest.php index ad31ace..5e69367 100644 --- a/tests/String/TrimStartTest.php +++ b/tests/String/TrimStartTest.php @@ -9,8 +9,8 @@ * @copyright Copyright (c) 2017 */ -use function _\trimStart; use PHPUnit\Framework\TestCase; +use function _\trimStart; class TrimStartTest extends TestCase { diff --git a/tests/Util/DefaultToTest.php b/tests/Util/DefaultToTest.php index f428473..9b6e8e6 100644 --- a/tests/Util/DefaultToTest.php +++ b/tests/Util/DefaultToTest.php @@ -1,26 +1,27 @@ - * @copyright Copyright (c) 2019 + * @copyright Copyright (c) 2017 */ -use function _\defaultTo; use PHPUnit\Framework\TestCase; +use function _\defaultTo; class DefaultToTest extends TestCase { public function testDefaultTo() { $null = null; - $default = "defaultValue"; - $realValue = "string"; - $this->assertSame($default, defaultTo($null, $default), "DefaultTo 1 failed"); - $this->assertSame($default, defaultTo(NAN, $default), "DefaultTo 2 failed"); - $this->assertSame($realValue, defaultTo($realValue, $default), "DefaultTo 3 failed"); - $this->assertSame("", defaultTo("", $default), "DefaultTo 4 failed"); + $default = 'defaultValue'; + $realValue = 'string'; + $this->assertSame($default, defaultTo($null, $default), 'DefaultTo 1 failed'); + $this->assertSame($default, defaultTo(NAN, $default), 'DefaultTo 2 failed'); + $this->assertSame($realValue, defaultTo($realValue, $default), 'DefaultTo 3 failed'); + $this->assertSame('', defaultTo('', $default), 'DefaultTo 4 failed'); } } diff --git a/tests/Util/PropertyTest.php b/tests/Util/PropertyTest.php index e0d7afa..287259f 100644 --- a/tests/Util/PropertyTest.php +++ b/tests/Util/PropertyTest.php @@ -9,10 +9,10 @@ * @copyright Copyright (c) 2017 */ -use function _\sortBy; use PHPUnit\Framework\TestCase; use function _\map; use function _\property; +use function _\sortBy; class PropertyTest extends TestCase { pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy