From 1f83744a3c0fcaa1883bce5b1c2d01b1a092ad6c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Aug 2021 15:09:48 +0000 Subject: [PATCH 1/2] composer(deps-dev): bump ergebnis/php-cs-fixer-config Bumps [ergebnis/php-cs-fixer-config](https://github.com/ergebnis/php-cs-fixer-config) from 2.13.1 to 2.14.0. - [Release notes](https://github.com/ergebnis/php-cs-fixer-config/releases) - [Changelog](https://github.com/ergebnis/php-cs-fixer-config/blob/main/CHANGELOG.md) - [Commits](https://github.com/ergebnis/php-cs-fixer-config/compare/2.13.1...2.14.0) Signed-off-by: dependabot[bot] --- composer.json | 2 +- composer.lock | 254 ++++++++++++++++++++++++++------------------------ 2 files changed, 132 insertions(+), 124 deletions(-) diff --git a/composer.json b/composer.json index 101ba8a0..6c284b2e 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "require-dev": { "ergebnis/composer-normalize": "^2.15.0", "ergebnis/license": "^1.1.0", - "ergebnis/php-cs-fixer-config": "^2.13.1", + "ergebnis/php-cs-fixer-config": "^2.14.0", "ergebnis/phpstan-rules": "~0.15.3", "ergebnis/test-util": "^1.4.0", "infection/infection": "~0.18.2", diff --git a/composer.lock b/composer.lock index f3fb73ef..c0e27b28 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "041079b3215ddbca089b21e7f3086130", + "content-hash": "c3fe5d58b548854b98771e6cd3fb27eb", "packages": [ { "name": "composer/package-versions-deprecated", @@ -81,28 +81,30 @@ }, { "name": "doctrine/annotations", - "version": "1.12.1", + "version": "1.13.2", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "b17c5014ef81d212ac539f07a1001832df1b6d3b" + "reference": "5b668aef16090008790395c02c893b1ba13f7e08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/b17c5014ef81d212ac539f07a1001832df1b6d3b", - "reference": "b17c5014ef81d212ac539f07a1001832df1b6d3b", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/5b668aef16090008790395c02c893b1ba13f7e08", + "reference": "5b668aef16090008790395c02c893b1ba13f7e08", "shasum": "" }, "require": { "doctrine/lexer": "1.*", "ext-tokenizer": "*", - "php": "^7.1 || ^8.0" + "php": "^7.1 || ^8.0", + "psr/cache": "^1 || ^2 || ^3" }, "require-dev": { - "doctrine/cache": "1.*", + "doctrine/cache": "^1.11 || ^2.0", "doctrine/coding-standard": "^6.0 || ^8.1", "phpstan/phpstan": "^0.12.20", - "phpunit/phpunit": "^7.5 || ^9.1.5" + "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", + "symfony/cache": "^4.4 || ^5.2" }, "type": "library", "autoload": { @@ -145,9 +147,9 @@ ], "support": { "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.12.1" + "source": "https://github.com/doctrine/annotations/tree/1.13.2" }, - "time": "2021-02-21T21:00:45+00:00" + "time": "2021-08-05T19:00:23+00:00" }, { "name": "doctrine/cache", @@ -1161,6 +1163,55 @@ }, "time": "2020-11-15T20:27:00+00:00" }, + { + "name": "psr/cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/master" + }, + "time": "2016-08-06T20:24:11+00:00" + }, { "name": "psr/container", "version": "1.1.1", @@ -2719,21 +2770,21 @@ }, { "name": "ergebnis/php-cs-fixer-config", - "version": "2.13.1", + "version": "2.14.0", "source": { "type": "git", "url": "https://github.com/ergebnis/php-cs-fixer-config.git", - "reference": "6662debce39a1373b151cd2ee8e00cedd0f371b1" + "reference": "5750f9c35b447619401838e9fb9b25f64b90eb93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ergebnis/php-cs-fixer-config/zipball/6662debce39a1373b151cd2ee8e00cedd0f371b1", - "reference": "6662debce39a1373b151cd2ee8e00cedd0f371b1", + "url": "https://api.github.com/repos/ergebnis/php-cs-fixer-config/zipball/5750f9c35b447619401838e9fb9b25f64b90eb93", + "reference": "5750f9c35b447619401838e9fb9b25f64b90eb93", "shasum": "" }, "require": { "ext-filter": "*", - "friendsofphp/php-cs-fixer": "~2.18.6", + "friendsofphp/php-cs-fixer": "~2.19.0", "php": "^7.2 || ^8.0" }, "require-dev": { @@ -2742,16 +2793,15 @@ "ergebnis/phpstan-rules": "~0.15.3", "ergebnis/test-util": "^1.5.0", "infection/infection": "~0.15.3", - "jangregor/phpstan-prophecy": "~0.8.1", "phpstan/extension-installer": "^1.1.0", - "phpstan/phpstan": "~0.12.84", + "phpstan/phpstan": "~0.12.85", "phpstan/phpstan-deprecation-rules": "~0.12.6", "phpstan/phpstan-phpunit": "~0.12.18", "phpstan/phpstan-strict-rules": "~0.12.9", "phpunit/phpunit": "^8.5.15", "psalm/plugin-phpunit": "~0.15.1", "symfony/filesystem": "^4.4.0", - "vimeo/psalm": "^4.7.0" + "vimeo/psalm": "^4.7.2" }, "type": "library", "extra": { @@ -2787,7 +2837,7 @@ "type": "github" } ], - "time": "2021-04-20T10:12:21+00:00" + "time": "2021-05-04T14:04:50+00:00" }, { "name": "ergebnis/phpstan-rules", @@ -3045,16 +3095,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.18.6", + "version": "v2.19.1", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "5fed214993e7863cef88a08f214344891299b9e4" + "reference": "1fa4af92841f67362c053728989b262fba8eb1ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/5fed214993e7863cef88a08f214344891299b9e4", - "reference": "5fed214993e7863cef88a08f214344891299b9e4", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/1fa4af92841f67362c053728989b262fba8eb1ec", + "reference": "1fa4af92841f67362c053728989b262fba8eb1ec", "shasum": "" }, "require": { @@ -3102,6 +3152,11 @@ "php-cs-fixer" ], "type": "application", + "extra": { + "branch-alias": { + "dev-master": "2.19-dev" + } + }, "autoload": { "psr-4": { "PhpCsFixer\\": "src/" @@ -3137,7 +3192,7 @@ "description": "A tool to automatically fix PHP code style", "support": { "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.18.6" + "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.19.1" }, "funding": [ { @@ -3145,7 +3200,7 @@ "type": "github" } ], - "time": "2021-04-19T19:45:11+00:00" + "time": "2021-08-02T17:52:09+00:00" }, { "name": "infection/abstract-testframework-adapter", @@ -5154,55 +5209,6 @@ }, "time": "2021-06-18T23:56:46+00:00" }, - { - "name": "psr/cache", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for caching libraries", - "keywords": [ - "cache", - "psr", - "psr-6" - ], - "support": { - "source": "https://github.com/php-fig/cache/tree/master" - }, - "time": "2016-08-06T20:24:11+00:00" - }, { "name": "psr/event-dispatcher", "version": "1.0.0", @@ -6561,23 +6567,23 @@ }, { "name": "symfony/event-dispatcher", - "version": "v5.2.4", + "version": "v5.3.4", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "d08d6ec121a425897951900ab692b612a61d6240" + "reference": "f2fd2208157553874560f3645d4594303058c4bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d08d6ec121a425897951900ab692b612a61d6240", - "reference": "d08d6ec121a425897951900ab692b612a61d6240", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/f2fd2208157553874560f3645d4594303058c4bd", + "reference": "f2fd2208157553874560f3645d4594303058c4bd", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/deprecation-contracts": "^2.1", "symfony/event-dispatcher-contracts": "^2", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "conflict": { "symfony/dependency-injection": "<4.4" @@ -6587,7 +6593,7 @@ "symfony/event-dispatcher-implementation": "2.0" }, "require-dev": { - "psr/log": "~1.0", + "psr/log": "^1|^2|^3", "symfony/config": "^4.4|^5.0", "symfony/dependency-injection": "^4.4|^5.0", "symfony/error-handler": "^4.4|^5.0", @@ -6626,7 +6632,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.2.4" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.3.4" }, "funding": [ { @@ -6642,7 +6648,7 @@ "type": "tidelift" } ], - "time": "2021-02-18T17:12:37+00:00" + "time": "2021-07-23T15:55:36+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -6725,21 +6731,22 @@ }, { "name": "symfony/filesystem", - "version": "v5.2.6", + "version": "v5.3.4", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "8c86a82f51658188119e62cff0a050a12d09836f" + "reference": "343f4fe324383ca46792cae728a3b6e2f708fb32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/8c86a82f51658188119e62cff0a050a12d09836f", - "reference": "8c86a82f51658188119e62cff0a050a12d09836f", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/343f4fe324383ca46792cae728a3b6e2f708fb32", + "reference": "343f4fe324383ca46792cae728a3b6e2f708fb32", "shasum": "" }, "require": { "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8" + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -6767,7 +6774,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.2.6" + "source": "https://github.com/symfony/filesystem/tree/v5.3.4" }, "funding": [ { @@ -6783,24 +6790,25 @@ "type": "tidelift" } ], - "time": "2021-03-28T14:30:26+00:00" + "time": "2021-07-21T12:40:44+00:00" }, { "name": "symfony/finder", - "version": "v5.2.4", + "version": "v5.3.4", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "0d639a0943822626290d169965804f79400e6a04" + "reference": "17f50e06018baec41551a71a15731287dbaab186" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/0d639a0943822626290d169965804f79400e6a04", - "reference": "0d639a0943822626290d169965804f79400e6a04", + "url": "https://api.github.com/repos/symfony/finder/zipball/17f50e06018baec41551a71a15731287dbaab186", + "reference": "17f50e06018baec41551a71a15731287dbaab186", "shasum": "" }, "require": { - "php": ">=7.2.5" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -6828,7 +6836,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.2.4" + "source": "https://github.com/symfony/finder/tree/v5.3.4" }, "funding": [ { @@ -6844,27 +6852,27 @@ "type": "tidelift" } ], - "time": "2021-02-15T18:55:04+00:00" + "time": "2021-07-23T15:54:19+00:00" }, { "name": "symfony/options-resolver", - "version": "v5.2.4", + "version": "v5.3.4", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce" + "reference": "a603e5701bd6e305cfc777a8b50bf081ef73105e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce", - "reference": "5d0f633f9bbfcf7ec642a2b5037268e61b0a62ce", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/a603e5701bd6e305cfc777a8b50bf081ef73105e", + "reference": "a603e5701bd6e305cfc777a8b50bf081ef73105e", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-php73": "~1.0", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -6897,7 +6905,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.2.4" + "source": "https://github.com/symfony/options-resolver/tree/v5.3.4" }, "funding": [ { @@ -6913,7 +6921,7 @@ "type": "tidelift" } ], - "time": "2021-01-27T12:56:27+00:00" + "time": "2021-07-23T15:55:36+00:00" }, { "name": "symfony/polyfill-php70", @@ -6985,16 +6993,16 @@ }, { "name": "symfony/polyfill-php72", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9" + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", - "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", "shasum": "" }, "require": { @@ -7003,7 +7011,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -7041,7 +7049,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.23.0" }, "funding": [ { @@ -7057,25 +7065,25 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-05-27T09:17:38+00:00" }, { "name": "symfony/process", - "version": "v5.2.4", + "version": "v5.3.4", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "313a38f09c77fbcdc1d223e57d368cea76a2fd2f" + "reference": "d16634ee55b895bd85ec714dadc58e4428ecf030" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/313a38f09c77fbcdc1d223e57d368cea76a2fd2f", - "reference": "313a38f09c77fbcdc1d223e57d368cea76a2fd2f", + "url": "https://api.github.com/repos/symfony/process/zipball/d16634ee55b895bd85ec714dadc58e4428ecf030", + "reference": "d16634ee55b895bd85ec714dadc58e4428ecf030", "shasum": "" }, "require": { "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -7103,7 +7111,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.2.4" + "source": "https://github.com/symfony/process/tree/v5.3.4" }, "funding": [ { @@ -7119,20 +7127,20 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:15:41+00:00" + "time": "2021-07-23T15:54:19+00:00" }, { "name": "symfony/stopwatch", - "version": "v5.2.4", + "version": "v5.3.4", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "b12274acfab9d9850c52583d136a24398cdf1a0c" + "reference": "b24c6a92c6db316fee69e38c80591e080e41536c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/b12274acfab9d9850c52583d136a24398cdf1a0c", - "reference": "b12274acfab9d9850c52583d136a24398cdf1a0c", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/b24c6a92c6db316fee69e38c80591e080e41536c", + "reference": "b24c6a92c6db316fee69e38c80591e080e41536c", "shasum": "" }, "require": { @@ -7165,7 +7173,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.2.4" + "source": "https://github.com/symfony/stopwatch/tree/v5.3.4" }, "funding": [ { @@ -7181,7 +7189,7 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:15:41+00:00" + "time": "2021-07-10T08:58:57+00:00" }, { "name": "symfony/var-exporter", From ef2be1ac236bff559838873767fa675cab706814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Wed, 18 Aug 2021 17:12:02 +0200 Subject: [PATCH 2/2] Fix: Run 'make coding-standards' --- .php_cs | 4 +- example/test/AutoReview/FixtureTest.php | 12 +- .../Entity/OrganizationDefinitionProvider.php | 2 +- example/test/Unit/AbstractTestCase.php | 6 +- src/Count.php | 6 +- src/Exception/ClassMetadataNotFound.php | 2 +- src/Exception/ClassNotFound.php | 2 +- .../EntityDefinitionAlreadyRegistered.php | 2 +- .../EntityDefinitionNotRegistered.php | 2 +- src/Exception/InvalidCount.php | 2 +- src/Exception/InvalidDefinition.php | 8 +- src/Exception/InvalidDirectory.php | 2 +- src/Exception/InvalidFieldDefinitions.php | 2 +- src/Exception/InvalidFieldNames.php | 2 +- src/Exception/InvalidMaximum.php | 2 +- src/Exception/InvalidMinimum.php | 2 +- src/Exception/InvalidSequence.php | 2 +- src/FieldDefinition.php | 6 +- src/FieldDefinition/Closure.php | 2 +- src/FieldDefinition/Optional.php | 2 +- src/FieldDefinition/References.php | 2 +- src/FieldDefinition/Sequence.php | 2 +- src/FixtureFactory.php | 36 +++--- src/Strategy/DefaultStrategy.php | 4 +- src/Strategy/WithOptionalStrategy.php | 4 +- src/Strategy/WithoutOptionalStrategy.php | 2 +- test/AutoReview/SrcCodeTest.php | 2 +- test/Double/Faker/FalseGenerator.php | 2 +- test/Double/Faker/TrueGenerator.php | 2 +- test/Integration/FixtureFactoryTest.php | 14 +-- test/Unit/CountTest.php | 12 +- test/Unit/EntityDefinitionTest.php | 4 +- .../Exception/ClassMetadataNotFoundTest.php | 2 +- test/Unit/Exception/ClassNotFoundTest.php | 2 +- .../EntityDefinitionAlreadyRegisteredTest.php | 2 +- .../EntityDefinitionNotRegisteredTest.php | 2 +- test/Unit/Exception/InvalidCountTest.php | 2 +- test/Unit/Exception/InvalidDefinitionTest.php | 8 +- test/Unit/Exception/InvalidDirectoryTest.php | 2 +- .../Exception/InvalidFieldDefinitionsTest.php | 2 +- test/Unit/Exception/InvalidFieldNamesTest.php | 8 +- test/Unit/Exception/InvalidMaximumTest.php | 4 +- test/Unit/Exception/InvalidMinimumTest.php | 2 +- test/Unit/Exception/InvalidSequenceTest.php | 2 +- test/Unit/FieldDefinition/ClosureTest.php | 4 +- test/Unit/FieldDefinition/OptionalTest.php | 4 +- test/Unit/FieldDefinition/ReferenceTest.php | 4 +- test/Unit/FieldDefinition/ReferencesTest.php | 6 +- test/Unit/FieldDefinition/SequenceTest.php | 10 +- test/Unit/FieldDefinition/ValueTest.php | 4 +- test/Unit/FieldDefinitionTest.php | 24 ++-- .../UsingDefaultStrategyTest.php | 54 ++++---- .../UsingWithOptionalStrategyTest.php | 60 ++++----- .../UsingWithoutOptionalStrategyTest.php | 54 ++++---- test/Unit/FixtureFactoryTest.php | 116 +++++++++--------- test/Unit/Strategy/DefaultStrategyTest.php | 36 +++--- .../Strategy/WithOptionalStrategyTest.php | 42 +++---- .../Strategy/WithoutOptionalStrategyTest.php | 26 ++-- .../Doctrine/ORM/EntityManagerFactory.php | 4 +- 59 files changed, 321 insertions(+), 321 deletions(-) diff --git a/.php_cs b/.php_cs index 54e0c28e..97d85ac8 100644 --- a/.php_cs +++ b/.php_cs @@ -18,10 +18,10 @@ $license = License\Type\MIT::markdown( __DIR__ . '/LICENSE.md', License\Range::since( License\Year::fromString('2020'), - new \DateTimeZone('UTC') + new \DateTimeZone('UTC'), ), License\Holder::fromString('Andreas Möller'), - License\Url::fromString('https://github.com/ergebnis/factory-bot') + License\Url::fromString('https://github.com/ergebnis/factory-bot'), ); $license->save(); diff --git a/example/test/AutoReview/FixtureTest.php b/example/test/AutoReview/FixtureTest.php index b232cb9f..56cf3de3 100644 --- a/example/test/AutoReview/FixtureTest.php +++ b/example/test/AutoReview/FixtureTest.php @@ -38,9 +38,9 @@ public function testEntitiesHaveEntityDefinitionProviders(): void return \str_replace( 'Example\\Entity\\', 'Example\\Test\\Fixture\\Entity\\', - $entityClassName + $entityClassName, ) . 'DefinitionProvider'; - }, $entityClassNames) + }, $entityClassNames), ); self::assertIsArray($expectedProviderClassNames); @@ -57,7 +57,7 @@ public function testEntitiesHaveEntityDefinitionProviders(): void $missingProviderClassNames = \array_diff( $expectedProviderClassNames, - $actualProviderClassNames + $actualProviderClassNames, ); $message = \sprintf( @@ -74,13 +74,13 @@ public function testEntitiesHaveEntityDefinitionProviders(): void , \implode( \PHP_EOL . ' - ', - \array_keys($missingProviderClassNames) + \array_keys($missingProviderClassNames), ), FactoryBot\EntityDefinitionProvider::class, \implode( \PHP_EOL . ' - ', - $missingProviderClassNames - ) + $missingProviderClassNames, + ), ); self::assertEmpty($missingProviderClassNames, $message); diff --git a/example/test/Fixture/Entity/OrganizationDefinitionProvider.php b/example/test/Fixture/Entity/OrganizationDefinitionProvider.php index 006f6bfa..9cde175d 100644 --- a/example/test/Fixture/Entity/OrganizationDefinitionProvider.php +++ b/example/test/Fixture/Entity/OrganizationDefinitionProvider.php @@ -30,7 +30,7 @@ public function accept(FactoryBot\FixtureFactory $fixtureFactory): void }), 'members' => FactoryBot\FieldDefinition::references( Entity\User::class, - FactoryBot\Count::between(1, 10) + FactoryBot\Count::between(1, 10), ), 'name' => FactoryBot\FieldDefinition::closure(static function (Generator $faker): string { return $faker->word; diff --git a/example/test/Unit/AbstractTestCase.php b/example/test/Unit/AbstractTestCase.php index 12c967fc..cc325c89 100644 --- a/example/test/Unit/AbstractTestCase.php +++ b/example/test/Unit/AbstractTestCase.php @@ -33,7 +33,7 @@ final protected static function entityManager(): ORM\EntityManagerInterface true, null, null, - false + false, ); $entityManager = ORM\EntityManager::create( @@ -41,7 +41,7 @@ final protected static function entityManager(): ORM\EntityManagerInterface 'driver' => 'pdo_sqlite', 'path' => ':memory:', ], - $configuration + $configuration, ); $schemaTool = new ORM\Tools\SchemaTool($entityManager); @@ -64,7 +64,7 @@ final protected static function fixtureFactory(): FactoryBot\FixtureFactory { $fixtureFactory = new FactoryBot\FixtureFactory( self::entityManager(), - self::faker() + self::faker(), ); $fixtureFactory->load(__DIR__ . '/../Fixture'); diff --git a/src/Count.php b/src/Count.php index d72a5908..13f9bf24 100644 --- a/src/Count.php +++ b/src/Count.php @@ -42,7 +42,7 @@ public static function exact(int $value): self return new self( $value, - $value + $value, ); } @@ -59,13 +59,13 @@ public static function between(int $minimum, int $maximum): self if ($maximum <= $minimum) { throw Exception\InvalidMaximum::notGreaterThanMinimum( $minimum, - $maximum + $maximum, ); } return new self( $minimum, - $maximum + $maximum, ); } diff --git a/src/Exception/ClassMetadataNotFound.php b/src/Exception/ClassMetadataNotFound.php index be12c14a..954582e2 100644 --- a/src/Exception/ClassMetadataNotFound.php +++ b/src/Exception/ClassMetadataNotFound.php @@ -19,7 +19,7 @@ public static function for(string $className): self { return new self(\sprintf( 'Class metadata for a class with the name "%s" could not be found.', - $className + $className, )); } } diff --git a/src/Exception/ClassNotFound.php b/src/Exception/ClassNotFound.php index 80cf0353..c8a0e3cc 100644 --- a/src/Exception/ClassNotFound.php +++ b/src/Exception/ClassNotFound.php @@ -19,7 +19,7 @@ public static function name(string $className): self { return new self(\sprintf( 'A class with the name "%s" could not be found.', - $className + $className, )); } } diff --git a/src/Exception/EntityDefinitionAlreadyRegistered.php b/src/Exception/EntityDefinitionAlreadyRegistered.php index 232e2f58..ddcfbebe 100644 --- a/src/Exception/EntityDefinitionAlreadyRegistered.php +++ b/src/Exception/EntityDefinitionAlreadyRegistered.php @@ -19,7 +19,7 @@ public static function for(string $className): self { return new self(\sprintf( 'An entity definition for class name "%s" has already been registered.', - $className + $className, )); } } diff --git a/src/Exception/EntityDefinitionNotRegistered.php b/src/Exception/EntityDefinitionNotRegistered.php index 327af3c8..0ab215d9 100644 --- a/src/Exception/EntityDefinitionNotRegistered.php +++ b/src/Exception/EntityDefinitionNotRegistered.php @@ -19,7 +19,7 @@ public static function for(string $className): self { return new self(\sprintf( 'An entity definition for class name "%s" has not been registered.', - $className + $className, )); } } diff --git a/src/Exception/InvalidCount.php b/src/Exception/InvalidCount.php index 207f63f1..91a904d3 100644 --- a/src/Exception/InvalidCount.php +++ b/src/Exception/InvalidCount.php @@ -19,7 +19,7 @@ public static function notGreaterThanOrEqualToZero(int $count): self { return new self(\sprintf( 'Count needs to be greater than or equal to 0, but %d is not.', - $count + $count, )); } } diff --git a/src/Exception/InvalidDefinition.php b/src/Exception/InvalidDefinition.php index 6bfb2d92..d3d6f30a 100644 --- a/src/Exception/InvalidDefinition.php +++ b/src/Exception/InvalidDefinition.php @@ -19,7 +19,7 @@ public static function canNotBeAutoloaded(string $className): self { return new self(\sprintf( 'Definition "%s" can not be autoloaded.', - $className + $className, )); } @@ -27,7 +27,7 @@ public static function canNotBeInstantiated(string $className): self { return new self(\sprintf( 'Definition "%s" can not be instantiated.', - $className + $className, )); } @@ -36,10 +36,10 @@ public static function throwsExceptionDuringInstantiation(string $className, \Ex return new self( \sprintf( 'An exception was thrown while trying to instantiate definition "%s".', - $className + $className, ), 0, - $exception + $exception, ); } } diff --git a/src/Exception/InvalidDirectory.php b/src/Exception/InvalidDirectory.php index 09dda7c4..762ce410 100644 --- a/src/Exception/InvalidDirectory.php +++ b/src/Exception/InvalidDirectory.php @@ -19,7 +19,7 @@ public static function notDirectory(string $directory): self { return new self(\sprintf( 'Directory should be a directory, but "%s" is not.', - $directory + $directory, )); } } diff --git a/src/Exception/InvalidFieldDefinitions.php b/src/Exception/InvalidFieldDefinitions.php index ce0a1274..2a870891 100644 --- a/src/Exception/InvalidFieldDefinitions.php +++ b/src/Exception/InvalidFieldDefinitions.php @@ -21,7 +21,7 @@ public static function values(): self { return new self(\sprintf( 'Field definitions need to be instances of "%s".', - FieldDefinition::class + FieldDefinition::class, )); } } diff --git a/src/Exception/InvalidFieldNames.php b/src/Exception/InvalidFieldNames.php index cae23ac1..9b6ff328 100644 --- a/src/Exception/InvalidFieldNames.php +++ b/src/Exception/InvalidFieldNames.php @@ -28,7 +28,7 @@ public static function notFoundIn(string $className, string ...$fieldNames): sel return new self(\sprintf( $template, $className, - \implode('", "', $fieldNames) + \implode('", "', $fieldNames), )); } } diff --git a/src/Exception/InvalidMaximum.php b/src/Exception/InvalidMaximum.php index 9ca6fc33..3b65ba66 100644 --- a/src/Exception/InvalidMaximum.php +++ b/src/Exception/InvalidMaximum.php @@ -20,7 +20,7 @@ public static function notGreaterThanMinimum(int $minimum, int $maximum): self return new self(\sprintf( 'Maximum needs to be greater than minimum %d, but %d is not.', $minimum, - $maximum + $maximum, )); } } diff --git a/src/Exception/InvalidMinimum.php b/src/Exception/InvalidMinimum.php index ef0737e7..d583a761 100644 --- a/src/Exception/InvalidMinimum.php +++ b/src/Exception/InvalidMinimum.php @@ -19,7 +19,7 @@ public static function notGreaterThanOrEqualToZero(int $minimum): self { return new self(\sprintf( 'Minimum needs to be greater than or equal to 0, but %d is not.', - $minimum + $minimum, )); } } diff --git a/src/Exception/InvalidSequence.php b/src/Exception/InvalidSequence.php index 62b42140..8f8cd79a 100644 --- a/src/Exception/InvalidSequence.php +++ b/src/Exception/InvalidSequence.php @@ -19,7 +19,7 @@ public static function value(string $value): self { return new self(\sprintf( 'Value needs to contain a placeholder "%%d", but "%s" does not', - $value + $value, )); } } diff --git a/src/FieldDefinition.php b/src/FieldDefinition.php index 28df6dc0..ca15ffbf 100644 --- a/src/FieldDefinition.php +++ b/src/FieldDefinition.php @@ -62,7 +62,7 @@ public static function references(string $className, Count $count): FieldDefinit { return new FieldDefinition\References( $className, - $count + $count, ); } @@ -73,7 +73,7 @@ public static function sequence(string $value, int $initialNumber = 1): FieldDef { return new FieldDefinition\Sequence( $value, - $initialNumber + $initialNumber, ); } @@ -81,7 +81,7 @@ public static function optionalSequence(string $value, int $initialNumber = 1): { return new FieldDefinition\Optional(new FieldDefinition\Sequence( $value, - $initialNumber + $initialNumber, )); } diff --git a/src/FieldDefinition/Closure.php b/src/FieldDefinition/Closure.php index 2dbc86f4..f75685f3 100644 --- a/src/FieldDefinition/Closure.php +++ b/src/FieldDefinition/Closure.php @@ -37,7 +37,7 @@ public function resolve(Generator $faker, FixtureFactory $fixtureFactory) return $closure( $faker, - $fixtureFactory + $fixtureFactory, ); } } diff --git a/src/FieldDefinition/Optional.php b/src/FieldDefinition/Optional.php index ce65b25c..4080287e 100644 --- a/src/FieldDefinition/Optional.php +++ b/src/FieldDefinition/Optional.php @@ -38,7 +38,7 @@ public function resolve(Generator $faker, FixtureFactory $fixtureFactory) { return $this->resolvable->resolve( $faker, - $fixtureFactory + $fixtureFactory, ); } } diff --git a/src/FieldDefinition/References.php b/src/FieldDefinition/References.php index 2d573e52..70c57227 100644 --- a/src/FieldDefinition/References.php +++ b/src/FieldDefinition/References.php @@ -62,7 +62,7 @@ public function resolve(Generator $faker, FixtureFactory $fixtureFactory): array { return $fixtureFactory->createMany( $this->className, - $this->count + $this->count, ); } } diff --git a/src/FieldDefinition/Sequence.php b/src/FieldDefinition/Sequence.php index 54145a95..8d29cb1e 100644 --- a/src/FieldDefinition/Sequence.php +++ b/src/FieldDefinition/Sequence.php @@ -50,7 +50,7 @@ public function resolve(Generator $faker, FixtureFactory $fixtureFactory): strin return \str_replace( '%d', (string) $this->sequentialNumber++, - $this->value + $this->value, ); } } diff --git a/src/FixtureFactory.php b/src/FixtureFactory.php index 4662c070..fd3fd7c5 100644 --- a/src/FixtureFactory.php +++ b/src/FixtureFactory.php @@ -89,7 +89,7 @@ public function define(string $className, array $fieldDefinitions = [], ?\Closur $allFieldNames = \array_merge( \array_keys($classMetadata->fieldMappings), \array_keys($classMetadata->associationMappings), - \array_keys($classMetadata->embeddedClasses) + \array_keys($classMetadata->embeddedClasses), ); $fieldNames = \array_filter($allFieldNames, static function (string $fieldName): bool { @@ -99,13 +99,13 @@ public function define(string $className, array $fieldDefinitions = [], ?\Closur /** @var array $extraFieldNames */ $extraFieldNames = \array_diff( \array_keys($fieldDefinitions), - $fieldNames + $fieldNames, ); if ([] !== $extraFieldNames) { throw Exception\InvalidFieldNames::notFoundIn( $classMetadata->getName(), - ...$extraFieldNames + ...$extraFieldNames, ); } @@ -121,7 +121,7 @@ public function define(string $className, array $fieldDefinitions = [], ?\Closur /** @var mixed $defaultFieldValue */ $defaultFieldValue = $classMetadata->getFieldValue( $defaultEntity, - $fieldName + $fieldName, ); $fieldDefinitions[$fieldName] = FieldDefinition::value($defaultFieldValue); @@ -136,7 +136,7 @@ public function define(string $className, array $fieldDefinitions = [], ?\Closur $this->entityDefinitions[$className] = new EntityDefinition( $classMetadata, $fieldDefinitions, - $afterCreate + $afterCreate, ); } @@ -180,7 +180,7 @@ public function load(string $directory): void } catch (\Exception $exception) { throw Exception\InvalidDefinition::throwsExceptionDuringInstantiation( $className, - $exception + $exception, ); } @@ -217,13 +217,13 @@ public function createOne(string $className, array $fieldDefinitionOverrides = [ $extraFieldNames = \array_diff( \array_keys($fieldDefinitionOverrides), - \array_keys($entityDefinition->fieldDefinitions()) + \array_keys($entityDefinition->fieldDefinitions()), ); if ([] !== $extraFieldNames) { throw Exception\InvalidFieldNames::notFoundIn( $entityDefinition->classMetadata()->getName(), - ...$extraFieldNames + ...$extraFieldNames, ); } @@ -235,14 +235,14 @@ public function createOne(string $className, array $fieldDefinitionOverrides = [ $fieldDefinitions = \array_merge( $entityDefinition->fieldDefinitions(), - self::normalizeFieldDefinitions($fieldDefinitionOverrides) + self::normalizeFieldDefinitions($fieldDefinitionOverrides), ); $fieldValues = \array_map(function (FieldDefinition\Resolvable $fieldDefinition) { return $this->resolutionStrategy->resolveFieldValue( $this->faker, $this, - $fieldDefinition + $fieldDefinition, ); }, $fieldDefinitions); @@ -251,7 +251,7 @@ public function createOne(string $className, array $fieldDefinitionOverrides = [ $entity, $entityDefinition, $fieldName, - $fieldValue + $fieldValue, ); } @@ -260,7 +260,7 @@ public function createOne(string $className, array $fieldDefinitionOverrides = [ $afterCreate( $entity, $fieldValues, - $this->faker + $this->faker, ); if ($this->persistAfterCreate && false === $classMetadata->isEmbeddedClass) { @@ -291,7 +291,7 @@ public function createMany(string $className, Count $count, array $fieldDefiniti { $resolved = $this->resolutionStrategy->resolveCount( $this->faker, - $count + $count, ); if (0 === $resolved) { @@ -301,7 +301,7 @@ public function createMany(string $className, Count $count, array $fieldDefiniti return \array_map(function () use ($className, $fieldDefinitionOverrides) { return $this->createOne( $className, - $fieldDefinitionOverrides + $fieldDefinitionOverrides, ); }, \range(1, $resolved)); } @@ -383,7 +383,7 @@ private function setField(object $entity, EntityDefinition $entityDefinition, st $classMetadata->setFieldValue( $entity, $fieldName, - self::collectionFrom($fieldValue) + self::collectionFrom($fieldValue), ); return; @@ -392,7 +392,7 @@ private function setField(object $entity, EntityDefinition $entityDefinition, st $classMetadata->setFieldValue( $entity, $fieldName, - $fieldValue + $fieldValue, ); if (!\is_object($fieldValue)) { @@ -407,7 +407,7 @@ private function setField(object $entity, EntityDefinition $entityDefinition, st $entity, $classMetadata, $fieldName, - $fieldValue + $fieldValue, ); } @@ -449,7 +449,7 @@ private function updateCollectionSideOfAssociation( $collection = $classMetadataOfFieldValue->getFieldValue( $fieldValue, - $inversedBy + $inversedBy, ); if (!$collection instanceof Common\Collections\Collection) { diff --git a/src/Strategy/DefaultStrategy.php b/src/Strategy/DefaultStrategy.php index 588dad47..ff20cec5 100644 --- a/src/Strategy/DefaultStrategy.php +++ b/src/Strategy/DefaultStrategy.php @@ -34,7 +34,7 @@ public function resolveFieldValue( return $fieldDefinition->resolve( $faker, - $fixtureFactory + $fixtureFactory, ); } @@ -42,7 +42,7 @@ public function resolveCount(Generator $faker, Count $count): int { return $faker->numberBetween( $count->minimum(), - $count->maximum() + $count->maximum(), ); } } diff --git a/src/Strategy/WithOptionalStrategy.php b/src/Strategy/WithOptionalStrategy.php index 59d85788..966f0c25 100644 --- a/src/Strategy/WithOptionalStrategy.php +++ b/src/Strategy/WithOptionalStrategy.php @@ -30,7 +30,7 @@ public function resolveFieldValue( ) { return $fieldDefinition->resolve( $faker, - $fixtureFactory + $fixtureFactory, ); } @@ -42,7 +42,7 @@ public function resolveCount(Generator $faker, Count $count): int $resolved = $faker->numberBetween( $count->minimum(), - $count->maximum() + $count->maximum(), ); if (0 === $resolved) { diff --git a/src/Strategy/WithoutOptionalStrategy.php b/src/Strategy/WithoutOptionalStrategy.php index 10c21f38..52e3dc1b 100644 --- a/src/Strategy/WithoutOptionalStrategy.php +++ b/src/Strategy/WithoutOptionalStrategy.php @@ -34,7 +34,7 @@ public function resolveFieldValue( return $fieldDefinition->resolve( $faker, - $fixtureFactory + $fixtureFactory, ); } diff --git a/test/AutoReview/SrcCodeTest.php b/test/AutoReview/SrcCodeTest.php index a61e55a4..baa1a494 100644 --- a/test/AutoReview/SrcCodeTest.php +++ b/test/AutoReview/SrcCodeTest.php @@ -34,7 +34,7 @@ public function testSrcClassesHaveUnitTests(): void 'Ergebnis\\FactoryBot\\Test\\Unit', [ FactoryBot\Strategy\DefaultStrategy::class, - ] + ], ); } } diff --git a/test/Double/Faker/FalseGenerator.php b/test/Double/Faker/FalseGenerator.php index a63d9473..223bd8e5 100644 --- a/test/Double/Faker/FalseGenerator.php +++ b/test/Double/Faker/FalseGenerator.php @@ -26,7 +26,7 @@ public function numberBetween($min = 0, $max = 2147483647): int { return \mt_rand( $min, - $max + $max, ); } } diff --git a/test/Double/Faker/TrueGenerator.php b/test/Double/Faker/TrueGenerator.php index 13920aba..5dff7d10 100644 --- a/test/Double/Faker/TrueGenerator.php +++ b/test/Double/Faker/TrueGenerator.php @@ -26,7 +26,7 @@ public function numberBetween($min = 0, $max = 2147483647): int { return \mt_rand( $min, - $max + $max, ); } } diff --git a/test/Integration/FixtureFactoryTest.php b/test/Integration/FixtureFactoryTest.php index bf56921c..8a283334 100644 --- a/test/Integration/FixtureFactoryTest.php +++ b/test/Integration/FixtureFactoryTest.php @@ -42,7 +42,7 @@ public function testCreateOneDoesNotPersistEntityByDefault(): void $fixtureFactory = new FixtureFactory( $entityManager, - $faker + $faker, ); $name = $faker->word; @@ -70,7 +70,7 @@ public function testCreateOnePersistsEntityWhenFixtureFactoryIsPersisting(): voi $fixtureFactory = new FixtureFactory( $entityManager, - $faker + $faker, ); $name = $faker->word; @@ -103,7 +103,7 @@ public function testCreateOneDoesNotPersistEmbeddablesWhenFixtureFactoryIsPersis $fixtureFactory = new FixtureFactory( $entityManager, - $faker + $faker, ); $fixtureFactory->define(Entity\Avatar::class, [ @@ -135,7 +135,7 @@ public function testCreateManyDoesNotPersistEntitiesByDefault(): void $fixtureFactory = new FixtureFactory( $entityManager, - self::faker() + self::faker(), ); $fixtureFactory->define(Entity\Organization::class, [ @@ -144,7 +144,7 @@ public function testCreateManyDoesNotPersistEntitiesByDefault(): void $fixtureFactory->createMany( Entity\Organization::class, - Count::exact(5) + Count::exact(5), ); $entityManager->flush(); @@ -162,7 +162,7 @@ public function testCreateManyPersistsEntitiesWhenFixtureFactoryIsPersisting(): $fixtureFactory = new FixtureFactory( $entityManager, - $faker + $faker, ); $fixtureFactory->define(Entity\Organization::class, [ @@ -178,7 +178,7 @@ public function testCreateManyPersistsEntitiesWhenFixtureFactoryIsPersisting(): $persistingFixtureFactory->createMany( Entity\Organization::class, - Count::exact($value) + Count::exact($value), ); $entityManager->flush(); diff --git a/test/Unit/CountTest.php b/test/Unit/CountTest.php index a5715dad..07829b5c 100644 --- a/test/Unit/CountTest.php +++ b/test/Unit/CountTest.php @@ -39,7 +39,7 @@ public function testExactRejectsValueLessThanZero(int $value): void $this->expectException(Exception\InvalidCount::class); $this->expectExceptionMessage(\sprintf( 'Count needs to be greater than or equal to 0, but %d is not.', - $value + $value, )); Count::exact($value); @@ -67,12 +67,12 @@ public function testBetweenRejectsMinimumLessThanZero(int $minimum): void $this->expectException(Exception\InvalidMinimum::class); $this->expectExceptionMessage(\sprintf( 'Minimum needs to be greater than or equal to 0, but %d is not.', - $minimum + $minimum, )); Count::between( $minimum, - $maximum + $maximum, ); } @@ -88,12 +88,12 @@ public function testBetweenRejectsMaximumNotGreaterThanMinimum(int $difference): $this->expectExceptionMessage(\sprintf( 'Maximum needs to be greater than minimum %d, but %d is not.', $minimum, - $maximum + $maximum, )); Count::between( $minimum, - $maximum + $maximum, ); } @@ -108,7 +108,7 @@ public function testBetweenReturnsCountWhenMinimumIsGreaterThanOrEqualToZeroAndM $count = Count::between( $minimum, - $maximum + $maximum, ); self::assertInstanceOf(Count::class, $count); diff --git a/test/Unit/EntityDefinitionTest.php b/test/Unit/EntityDefinitionTest.php index 05a06eee..6d026a75 100644 --- a/test/Unit/EntityDefinitionTest.php +++ b/test/Unit/EntityDefinitionTest.php @@ -52,7 +52,7 @@ public function testConstructorRejectsFieldDefinitionsWhenValuesAreNotFieldDefin $fieldDefinitions, static function ($entity, array $fieldValues): void { // intentionally left blank - } + }, ); } @@ -72,7 +72,7 @@ public function testConstructorSetsValues(): void $entityDefiniton = new EntityDefinition( $classMetadata, $fieldDefinitions, - $afterCreate + $afterCreate, ); self::assertSame($classMetadata, $entityDefiniton->classMetadata()); diff --git a/test/Unit/Exception/ClassMetadataNotFoundTest.php b/test/Unit/Exception/ClassMetadataNotFoundTest.php index 9063c15b..478442d9 100644 --- a/test/Unit/Exception/ClassMetadataNotFoundTest.php +++ b/test/Unit/Exception/ClassMetadataNotFoundTest.php @@ -31,7 +31,7 @@ public function testNameReturnsException(): void $message = \sprintf( 'Class metadata for a class with the name "%s" could not be found.', - $className + $className, ); self::assertInstanceOf(Exception\ClassMetadataNotFound::class, $exception); diff --git a/test/Unit/Exception/ClassNotFoundTest.php b/test/Unit/Exception/ClassNotFoundTest.php index c689af71..2ec3bf77 100644 --- a/test/Unit/Exception/ClassNotFoundTest.php +++ b/test/Unit/Exception/ClassNotFoundTest.php @@ -31,7 +31,7 @@ public function testNameReturnsException(): void $message = \sprintf( 'A class with the name "%s" could not be found.', - $className + $className, ); self::assertInstanceOf(Exception\ClassNotFound::class, $exception); diff --git a/test/Unit/Exception/EntityDefinitionAlreadyRegisteredTest.php b/test/Unit/Exception/EntityDefinitionAlreadyRegisteredTest.php index a70ef9b9..488c6122 100644 --- a/test/Unit/Exception/EntityDefinitionAlreadyRegisteredTest.php +++ b/test/Unit/Exception/EntityDefinitionAlreadyRegisteredTest.php @@ -31,7 +31,7 @@ public function testForReturnsException(): void $message = \sprintf( 'An entity definition for class name "%s" has already been registered.', - $className + $className, ); self::assertInstanceOf(Exception\EntityDefinitionAlreadyRegistered::class, $exception); diff --git a/test/Unit/Exception/EntityDefinitionNotRegisteredTest.php b/test/Unit/Exception/EntityDefinitionNotRegisteredTest.php index 353897b4..f17a07ab 100644 --- a/test/Unit/Exception/EntityDefinitionNotRegisteredTest.php +++ b/test/Unit/Exception/EntityDefinitionNotRegisteredTest.php @@ -31,7 +31,7 @@ public function testForReturnsException(): void $message = \sprintf( 'An entity definition for class name "%s" has not been registered.', - $className + $className, ); self::assertInstanceOf(Exception\EntityDefinitionNotRegistered::class, $exception); diff --git a/test/Unit/Exception/InvalidCountTest.php b/test/Unit/Exception/InvalidCountTest.php index c7e0fb41..91eee578 100644 --- a/test/Unit/Exception/InvalidCountTest.php +++ b/test/Unit/Exception/InvalidCountTest.php @@ -34,7 +34,7 @@ public function testNotGreaterThanOrEqualToReturnsException(): void $message = \sprintf( 'Count needs to be greater than or equal to 0, but %d is not.', - $value + $value, ); self::assertInstanceOf(Exception\InvalidCount::class, $exception); diff --git a/test/Unit/Exception/InvalidDefinitionTest.php b/test/Unit/Exception/InvalidDefinitionTest.php index fec6ba10..dd27681f 100644 --- a/test/Unit/Exception/InvalidDefinitionTest.php +++ b/test/Unit/Exception/InvalidDefinitionTest.php @@ -38,7 +38,7 @@ public function testCanNotBeAutoloadedReturnsException(): void $message = \sprintf( 'Definition "%s" can not be autoloaded.', - $className + $className, ); self::assertSame($message, $exception->getMessage()); @@ -56,7 +56,7 @@ public function testCanNotBeInstantiatedReturnsException(): void $message = \sprintf( 'Definition "%s" can not be instantiated.', - $className + $className, ); self::assertSame($message, $exception->getMessage()); @@ -69,7 +69,7 @@ public function testThrowsExceptionDuringInstantiationReturnsException(): void $exception = Exception\InvalidDefinition::throwsExceptionDuringInstantiation( $className, - $previousException + $previousException, ); self::assertInstanceOf(Exception\InvalidDefinition::class, $exception); @@ -78,7 +78,7 @@ public function testThrowsExceptionDuringInstantiationReturnsException(): void $message = \sprintf( 'An exception was thrown while trying to instantiate definition "%s".', - $className + $className, ); self::assertSame($message, $exception->getMessage()); diff --git a/test/Unit/Exception/InvalidDirectoryTest.php b/test/Unit/Exception/InvalidDirectoryTest.php index 3eb29e91..49eecf98 100644 --- a/test/Unit/Exception/InvalidDirectoryTest.php +++ b/test/Unit/Exception/InvalidDirectoryTest.php @@ -34,7 +34,7 @@ public function testNotDirectoryCreatesException(): void $message = \sprintf( 'Directory should be a directory, but "%s" is not.', - $directory + $directory, ); self::assertInstanceOf(Exception\InvalidDirectory::class, $exception); diff --git a/test/Unit/Exception/InvalidFieldDefinitionsTest.php b/test/Unit/Exception/InvalidFieldDefinitionsTest.php index e6653429..ec50d4f4 100644 --- a/test/Unit/Exception/InvalidFieldDefinitionsTest.php +++ b/test/Unit/Exception/InvalidFieldDefinitionsTest.php @@ -33,7 +33,7 @@ public function testFromClassNameCreatesException(): void $message = \sprintf( 'Field definitions need to be instances of "%s".', - FieldDefinition::class + FieldDefinition::class, ); self::assertInstanceOf(Exception\InvalidFieldDefinitions::class, $exception); diff --git a/test/Unit/Exception/InvalidFieldNamesTest.php b/test/Unit/Exception/InvalidFieldNamesTest.php index d17d0da1..8b817c60 100644 --- a/test/Unit/Exception/InvalidFieldNamesTest.php +++ b/test/Unit/Exception/InvalidFieldNamesTest.php @@ -35,13 +35,13 @@ public function testNotFoundInReturnsExceptionWhenOnlyOneFieldNameIsProvided(): $exception = Exception\InvalidFieldNames::notFoundIn( $className, - $fieldName + $fieldName, ); $message = \sprintf( 'Entity "%s" does not have a field with the name "%s".', $className, - $fieldName + $fieldName, ); self::assertInstanceOf(Exception\InvalidFieldNames::class, $exception); @@ -62,7 +62,7 @@ public function testNotFoundInReturnsExceptionWhenMoreThanOneFieldNameIsProvided $exception = Exception\InvalidFieldNames::notFoundIn( $className, - ...$fieldNames + ...$fieldNames, ); $sortedFieldNames = $fieldNames; @@ -72,7 +72,7 @@ public function testNotFoundInReturnsExceptionWhenMoreThanOneFieldNameIsProvided $message = \sprintf( 'Entity "%s" does not have fields with the names "%s".', $className, - \implode('", "', $sortedFieldNames) + \implode('", "', $sortedFieldNames), ); self::assertInstanceOf(Exception\InvalidFieldNames::class, $exception); diff --git a/test/Unit/Exception/InvalidMaximumTest.php b/test/Unit/Exception/InvalidMaximumTest.php index 68c7c586..2e50bf40 100644 --- a/test/Unit/Exception/InvalidMaximumTest.php +++ b/test/Unit/Exception/InvalidMaximumTest.php @@ -33,13 +33,13 @@ public function testNotGreaterThanMinimumReturnsException(): void $exception = Exception\InvalidMaximum::notGreaterThanMinimum( $minimum, - $maximum + $maximum, ); $message = \sprintf( 'Maximum needs to be greater than minimum %d, but %d is not.', $minimum, - $maximum + $maximum, ); self::assertInstanceOf(Exception\InvalidMaximum::class, $exception); diff --git a/test/Unit/Exception/InvalidMinimumTest.php b/test/Unit/Exception/InvalidMinimumTest.php index 20f8d9fd..99ba2c34 100644 --- a/test/Unit/Exception/InvalidMinimumTest.php +++ b/test/Unit/Exception/InvalidMinimumTest.php @@ -34,7 +34,7 @@ public function testNotGreaterThanOrEqualToReturnsException(): void $message = \sprintf( 'Minimum needs to be greater than or equal to 0, but %d is not.', - $minimum + $minimum, ); self::assertInstanceOf(Exception\InvalidMinimum::class, $exception); diff --git a/test/Unit/Exception/InvalidSequenceTest.php b/test/Unit/Exception/InvalidSequenceTest.php index 98bfb9b7..f991565c 100644 --- a/test/Unit/Exception/InvalidSequenceTest.php +++ b/test/Unit/Exception/InvalidSequenceTest.php @@ -34,7 +34,7 @@ public function testValueReturnsException(): void $message = \sprintf( 'Value needs to contain a placeholder "%%d", but "%s" does not', - $value + $value, ); self::assertInstanceOf(Exception\InvalidSequence::class, $exception); diff --git a/test/Unit/FieldDefinition/ClosureTest.php b/test/Unit/FieldDefinition/ClosureTest.php index e2b6e000..a894c194 100644 --- a/test/Unit/FieldDefinition/ClosureTest.php +++ b/test/Unit/FieldDefinition/ClosureTest.php @@ -38,7 +38,7 @@ public function testResolvesToResultOfInvokingClosureWithFakerAndFixtureFactory( $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fixtureFactory->define(Entity\User::class); @@ -51,7 +51,7 @@ public function testResolvesToResultOfInvokingClosureWithFakerAndFixtureFactory( $resolved = $fieldDefinition->resolve( $faker, - $fixtureFactory + $fixtureFactory, ); self::assertInstanceOf(Entity\User::class, $resolved); diff --git a/test/Unit/FieldDefinition/OptionalTest.php b/test/Unit/FieldDefinition/OptionalTest.php index 2b022992..b6a1a8f1 100644 --- a/test/Unit/FieldDefinition/OptionalTest.php +++ b/test/Unit/FieldDefinition/OptionalTest.php @@ -39,7 +39,7 @@ public function testResolvesToResultOfResolvingResolvableWithFixtureFactory(): v $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fixtureFactory->define(Entity\User::class); @@ -55,7 +55,7 @@ public function resolve(Generator $faker, FixtureFactory $fixtureFactory) $resolved = $fieldDefinition->resolve( $faker, - $fixtureFactory + $fixtureFactory, ); self::assertInstanceOf(Entity\User::class, $resolved); diff --git a/test/Unit/FieldDefinition/ReferenceTest.php b/test/Unit/FieldDefinition/ReferenceTest.php index afa22c15..afd11933 100644 --- a/test/Unit/FieldDefinition/ReferenceTest.php +++ b/test/Unit/FieldDefinition/ReferenceTest.php @@ -39,7 +39,7 @@ public function testResolvesToObjectCreatedByFixtureFactory(): void $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fixtureFactory->define($className); @@ -48,7 +48,7 @@ public function testResolvesToObjectCreatedByFixtureFactory(): void $resolved = $fieldDefinition->resolve( $faker, - $fixtureFactory + $fixtureFactory, ); self::assertInstanceOf($className, $resolved); diff --git a/test/Unit/FieldDefinition/ReferencesTest.php b/test/Unit/FieldDefinition/ReferencesTest.php index 0d828684..d61e2cbd 100644 --- a/test/Unit/FieldDefinition/ReferencesTest.php +++ b/test/Unit/FieldDefinition/ReferencesTest.php @@ -44,19 +44,19 @@ public function testResolvesToArrayOfObjectsCreatedByFixtureFactory(int $value): $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fixtureFactory->define($className); $fieldDefinition = new References( $className, - Count::exact($value) + Count::exact($value), ); $resolved = $fieldDefinition->resolve( $faker, - $fixtureFactory + $fixtureFactory, ); self::assertIsArray($resolved); diff --git a/test/Unit/FieldDefinition/SequenceTest.php b/test/Unit/FieldDefinition/SequenceTest.php index 583a0c22..b7101025 100644 --- a/test/Unit/FieldDefinition/SequenceTest.php +++ b/test/Unit/FieldDefinition/SequenceTest.php @@ -38,12 +38,12 @@ public function testConstructorRejectsValueWhenItIsMissingPercentDPlaceholder(): $this->expectException(Exception\InvalidSequence::class); $this->expectExceptionMessage(\sprintf( 'Value needs to contain a placeholder "%%d", but "%s" does not', - $value + $value, )); new Sequence( $value, - $initialNumber + $initialNumber, ); } @@ -53,7 +53,7 @@ public function testResolvesToValueWithPercentDReplacedWithSequentialNumber(): v $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $value = '%d Why, hello - this is a nice thing, if you need it! %d'; @@ -62,14 +62,14 @@ public function testResolvesToValueWithPercentDReplacedWithSequentialNumber(): v $fieldDefinition = new Sequence( $value, - $initialNumber + $initialNumber, ); $expected = static function (int $sequentialNumber): string { return \sprintf( '%d Why, hello - this is a nice thing, if you need it! %d', $sequentialNumber, - $sequentialNumber + $sequentialNumber, ); }; diff --git a/test/Unit/FieldDefinition/ValueTest.php b/test/Unit/FieldDefinition/ValueTest.php index 9e6db76f..4ce9afb4 100644 --- a/test/Unit/FieldDefinition/ValueTest.php +++ b/test/Unit/FieldDefinition/ValueTest.php @@ -39,14 +39,14 @@ public function testResolvesToValue($value): void $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fieldDefinition = new Value($value); $resolved = $fieldDefinition->resolve( $faker, - $fixtureFactory + $fixtureFactory, ); self::assertSame($value, $resolved); diff --git a/test/Unit/FieldDefinitionTest.php b/test/Unit/FieldDefinitionTest.php index d1c80579..e40dbac4 100644 --- a/test/Unit/FieldDefinitionTest.php +++ b/test/Unit/FieldDefinitionTest.php @@ -104,12 +104,12 @@ public function testReferencesReturnsReferencesWhenCountIsSpecified(int $value): $fieldDefinition = FieldDefinition::references( $className, - Count::exact($value) + Count::exact($value), ); $expected = new FieldDefinition\References( $className, - Count::exact($value) + Count::exact($value), ); self::assertEquals($expected, $fieldDefinition); @@ -125,12 +125,12 @@ public function testSequenceRejectsValueWhenItIsMissingPercentDPlaceholder(): vo $this->expectException(Exception\InvalidSequence::class); $this->expectExceptionMessage(\sprintf( 'Value needs to contain a placeholder "%%d", but "%s" does not', - $value + $value, )); FieldDefinition::sequence( $value, - $initialNumber + $initialNumber, ); } @@ -142,7 +142,7 @@ public function testSequenceReturnsSequenceWhenValueContainsPlaceholderAndInitia $expected = new FieldDefinition\Sequence( $value, - 1 + 1, ); self::assertEquals($expected, $fieldDefinition); @@ -157,12 +157,12 @@ public function testSequenceReturnsSequenceWhenValueContainsPlaceholderAndInitia $fieldDefinition = FieldDefinition::sequence( $value, - $initialNumber + $initialNumber, ); $expected = new FieldDefinition\Sequence( $value, - $initialNumber + $initialNumber, ); self::assertEquals($expected, $fieldDefinition); @@ -178,12 +178,12 @@ public function testOptionalSequenceRejectsValueWhenItIsMissingPercentDPlacehold $this->expectException(Exception\InvalidSequence::class); $this->expectExceptionMessage(\sprintf( 'Value needs to contain a placeholder "%%d", but "%s" does not', - $value + $value, )); FieldDefinition::optionalSequence( $value, - $initialNumber + $initialNumber, ); } @@ -195,7 +195,7 @@ public function testOptionalSequenceReturnsOptionalSequenceWhenValueContainsPlac $expected = new FieldDefinition\Optional(new FieldDefinition\Sequence( $value, - 1 + 1, )); self::assertEquals($expected, $fieldDefinition); @@ -210,12 +210,12 @@ public function testOptionalSequenceReturnsOptionalSequenceWhenValueContainsPlac $fieldDefinition = FieldDefinition::optionalSequence( $value, - $initialNumber + $initialNumber, ); $expected = new FieldDefinition\Optional(new FieldDefinition\Sequence( $value, - $initialNumber + $initialNumber, )); self::assertEquals($expected, $fieldDefinition); diff --git a/test/Unit/FixtureFactory/UsingDefaultStrategyTest.php b/test/Unit/FixtureFactory/UsingDefaultStrategyTest.php index 0e131b28..7c27bf1a 100644 --- a/test/Unit/FixtureFactory/UsingDefaultStrategyTest.php +++ b/test/Unit/FixtureFactory/UsingDefaultStrategyTest.php @@ -43,7 +43,7 @@ public function testCreateOneResolvesOptionalClosureToNullWhenFakerReturnsFalse( { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\FalseGenerator() + new Double\Faker\FalseGenerator(), ); $fixtureFactory->define(Entity\CodeOfConduct::class); @@ -64,7 +64,7 @@ public function testCreateOneResolvesOptionalClosureToResultOfClosureInvokedWith { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\TrueGenerator() + new Double\Faker\TrueGenerator(), ); $fixtureFactory->define(Entity\CodeOfConduct::class); @@ -85,7 +85,7 @@ public function testCreateOneResolvesClosureToResultOfClosureInvokedWithFakerAnd { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\FalseGenerator() + new Double\Faker\FalseGenerator(), ); $fixtureFactory->define(Entity\CodeOfConduct::class); @@ -106,7 +106,7 @@ public function testCreateOneResolvesClosureToResultOfClosureInvokedWithFakerAnd { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\TrueGenerator() + new Double\Faker\TrueGenerator(), ); $fixtureFactory->define(Entity\CodeOfConduct::class); @@ -127,7 +127,7 @@ public function testCreateOneResolvesOptionalReferenceToNullWhenFakerReturnsFals { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\FalseGenerator() + new Double\Faker\FalseGenerator(), ); $fixtureFactory->define(Entity\CodeOfConduct::class); @@ -146,7 +146,7 @@ public function testCreateOneResolvesOptionalReferenceToEntityWhenFakerReturnsTr { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\TrueGenerator() + new Double\Faker\TrueGenerator(), ); $fixtureFactory->define(Entity\CodeOfConduct::class); @@ -165,7 +165,7 @@ public function testCreateOneResolvesReferenceToEntityWhenFakerReturnsFalse(): v { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\FalseGenerator() + new Double\Faker\FalseGenerator(), ); $fixtureFactory->define(Entity\CodeOfConduct::class); @@ -184,7 +184,7 @@ public function testCreateOneResolvesReferenceToEntityWhenFakerReturnsTrue(): vo { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\TrueGenerator() + new Double\Faker\TrueGenerator(), ); $fixtureFactory->define(Entity\CodeOfConduct::class); @@ -206,13 +206,13 @@ public function testCreateOneResolvesReferencesToArrayCollectionOfEntitiesWhenFa { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\FalseGenerator() + new Double\Faker\FalseGenerator(), ); $fixtureFactory->define(Entity\Organization::class, [ 'repositories' => FieldDefinition::references( Entity\Repository::class, - Count::exact($value) + Count::exact($value), ), ]); @@ -234,13 +234,13 @@ public function testCreateOneResolvesReferencesToArrayCollectionOfEntitiesWhenFa { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\TrueGenerator() + new Double\Faker\TrueGenerator(), ); $fixtureFactory->define(Entity\Organization::class, [ 'repositories' => FieldDefinition::references( Entity\Repository::class, - Count::exact($value) + Count::exact($value), ), ]); @@ -266,7 +266,7 @@ public function testCreateOneResolvesReferencesToArrayCollectionOfEntitiesWhenFa $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\FalseGenerator() + new Double\Faker\FalseGenerator(), ); $fixtureFactory->define(Entity\Organization::class, [ @@ -274,8 +274,8 @@ public function testCreateOneResolvesReferencesToArrayCollectionOfEntitiesWhenFa Entity\Repository::class, Count::between( $minimum, - $maximum - ) + $maximum, + ), ), ]); @@ -300,7 +300,7 @@ public function testCreateOneResolvesReferencesToArrayCollectionOfEntitiesWhenFa $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\TrueGenerator() + new Double\Faker\TrueGenerator(), ); $fixtureFactory->define(Entity\Organization::class, [ @@ -308,8 +308,8 @@ public function testCreateOneResolvesReferencesToArrayCollectionOfEntitiesWhenFa Entity\Repository::class, Count::between( $minimum, - $maximum - ) + $maximum, + ), ), ]); @@ -329,7 +329,7 @@ public function testCreateOneResolvesOptionalSequenceToNullWhenFakerReturnsFalse { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\FalseGenerator() + new Double\Faker\FalseGenerator(), ); $fixtureFactory->define(Entity\User::class, [ @@ -346,7 +346,7 @@ public function testCreateOneResolvesOptionalSequenceToStringValueWhenPercentDPl { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\TrueGenerator() + new Double\Faker\TrueGenerator(), ); $fixtureFactory->define(Entity\User::class, [ @@ -371,7 +371,7 @@ public function testCreateOneResolvesSequenceToStringValueWhenPercentDPlaceholde { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\FalseGenerator() + new Double\Faker\FalseGenerator(), ); $fixtureFactory->define(Entity\User::class, [ @@ -396,7 +396,7 @@ public function testCreateOneResolvesSequenceToStringValueWhenPercentDPlaceholde { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\TrueGenerator() + new Double\Faker\TrueGenerator(), ); $fixtureFactory->define(Entity\User::class, [ @@ -424,14 +424,14 @@ public function testCreateManyResolvesToArrayOfEntitiesWhenCountIsExact(int $val { $fixtureFactory = new FixtureFactory( self::entityManager(), - self::faker() + self::faker(), ); $fixtureFactory->define(Entity\Organization::class); $entities = $fixtureFactory->createMany( Entity\Organization::class, - Count::exact($value) + Count::exact($value), ); self::assertCount($value, $entities); @@ -446,7 +446,7 @@ public function testCreateManyResolvesToArrayOfEntitiesWhenCountIsBetween(): voi $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fixtureFactory->define(Entity\Organization::class); @@ -455,8 +455,8 @@ public function testCreateManyResolvesToArrayOfEntitiesWhenCountIsBetween(): voi Entity\Organization::class, Count::between( $minimum, - $maximum - ) + $maximum, + ), ); self::assertGreaterThanOrEqual($minimum, \count($entities)); diff --git a/test/Unit/FixtureFactory/UsingWithOptionalStrategyTest.php b/test/Unit/FixtureFactory/UsingWithOptionalStrategyTest.php index d5963740..2619a301 100644 --- a/test/Unit/FixtureFactory/UsingWithOptionalStrategyTest.php +++ b/test/Unit/FixtureFactory/UsingWithOptionalStrategyTest.php @@ -44,7 +44,7 @@ public function testCreateOneResolvesOptionalClosureToResultOfClosureInvokedWith { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\FalseGenerator() + new Double\Faker\FalseGenerator(), ); $fixtureFactory->define(Entity\CodeOfConduct::class); @@ -67,7 +67,7 @@ public function testCreateOneResolvesOptionalClosureToResultOfClosureInvokedWith { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\TrueGenerator() + new Double\Faker\TrueGenerator(), ); $fixtureFactory->define(Entity\CodeOfConduct::class); @@ -90,7 +90,7 @@ public function testCreateOneResolvesClosureToResultOfClosureInvokedWithFakerAnd { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\FalseGenerator() + new Double\Faker\FalseGenerator(), ); $fixtureFactory->define(Entity\CodeOfConduct::class); @@ -113,7 +113,7 @@ public function testCreateOneResolvesClosureToResultOfClosureInvokedWithFakerAnd { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\TrueGenerator() + new Double\Faker\TrueGenerator(), ); $fixtureFactory->define(Entity\CodeOfConduct::class); @@ -136,7 +136,7 @@ public function testCreateOneResolvesOptionalReferenceToEntityWhenFakerReturnsFa { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\FalseGenerator() + new Double\Faker\FalseGenerator(), ); $fixtureFactory->define(Entity\CodeOfConduct::class); @@ -157,7 +157,7 @@ public function testCreateOneResolvesOptionalReferenceToEntityWhenFakerReturnsTr { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\TrueGenerator() + new Double\Faker\TrueGenerator(), ); $fixtureFactory->define(Entity\CodeOfConduct::class); @@ -178,7 +178,7 @@ public function testCreateOneResolvesReferenceToEntityWhenFakerReturnsFalse(): v { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\FalseGenerator() + new Double\Faker\FalseGenerator(), ); $fixtureFactory->define(Entity\CodeOfConduct::class); @@ -199,7 +199,7 @@ public function testCreateOneResolvesReferenceToEntityWhenFakerReturnsTrue(): vo { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\TrueGenerator() + new Double\Faker\TrueGenerator(), ); $fixtureFactory->define(Entity\CodeOfConduct::class); @@ -223,13 +223,13 @@ public function testCreateOneResolvesReferencesToArrayCollectionOfEntitiesWhenFa { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\FalseGenerator() + new Double\Faker\FalseGenerator(), ); $fixtureFactory->define(Entity\Organization::class, [ 'repositories' => FieldDefinition::references( Entity\Repository::class, - Count::exact($value) + Count::exact($value), ), ]); @@ -253,13 +253,13 @@ public function testCreateOneResolvesReferencesToArrayCollectionOfEntitiesWhenFa { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\TrueGenerator() + new Double\Faker\TrueGenerator(), ); $fixtureFactory->define(Entity\Organization::class, [ 'repositories' => FieldDefinition::references( Entity\Repository::class, - Count::exact($value) + Count::exact($value), ), ]); @@ -287,7 +287,7 @@ public function testCreateOneResolvesReferencesToArrayCollectionOfEntitiesWhenFa $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\FalseGenerator() + new Double\Faker\FalseGenerator(), ); $fixtureFactory->define(Entity\Organization::class, [ @@ -295,8 +295,8 @@ public function testCreateOneResolvesReferencesToArrayCollectionOfEntitiesWhenFa Entity\Repository::class, Count::between( $minimum, - $maximum - ) + $maximum, + ), ), ]); @@ -323,7 +323,7 @@ public function testCreateOneResolvesReferencesToArrayCollectionOfEntitiesWhenFa $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\TrueGenerator() + new Double\Faker\TrueGenerator(), ); $fixtureFactory->define(Entity\Organization::class, [ @@ -331,8 +331,8 @@ public function testCreateOneResolvesReferencesToArrayCollectionOfEntitiesWhenFa Entity\Repository::class, Count::between( $minimum, - $maximum - ) + $maximum, + ), ), ]); @@ -354,7 +354,7 @@ public function testCreateOneResolvesOptionalSequenceToToStringValueWhenPercentD { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\FalseGenerator() + new Double\Faker\FalseGenerator(), ); $fixtureFactory->define(Entity\User::class, [ @@ -381,7 +381,7 @@ public function testCreateOneResolvesOptionalSequenceToStringValueWhenPercentDPl { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\TrueGenerator() + new Double\Faker\TrueGenerator(), ); $fixtureFactory->define(Entity\User::class, [ @@ -408,7 +408,7 @@ public function testCreateOneResolvesSequenceToStringValueWhenPercentDPlaceholde { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\FalseGenerator() + new Double\Faker\FalseGenerator(), ); $fixtureFactory->define(Entity\User::class, [ @@ -435,7 +435,7 @@ public function testCreateOneResolvesSequenceToStringValueWhenPercentDPlaceholde { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\TrueGenerator() + new Double\Faker\TrueGenerator(), ); $fixtureFactory->define(Entity\User::class, [ @@ -465,7 +465,7 @@ public function testCreateManyResolvesToArrayOfEntitiesWhenCountIsExact(int $val { $fixtureFactory = new FixtureFactory( self::entityManager(), - self::faker() + self::faker(), ); $fixtureFactory->define(Entity\Organization::class); @@ -474,7 +474,7 @@ public function testCreateManyResolvesToArrayOfEntitiesWhenCountIsExact(int $val $entities = $withOptionalFixtureFactory->createMany( Entity\Organization::class, - Count::exact($value) + Count::exact($value), ); self::assertCount($value, $entities); @@ -487,7 +487,7 @@ public function testCreateManyResolvesToNonEmptyArrayOfEntitiesWhenCountIsBetwee $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\MinimumGenerator() + new Double\Faker\MinimumGenerator(), ); $fixtureFactory->define(Entity\Organization::class); @@ -498,8 +498,8 @@ public function testCreateManyResolvesToNonEmptyArrayOfEntitiesWhenCountIsBetwee Entity\Organization::class, Count::between( $minimum, - $maximum - ) + $maximum, + ), ); self::assertCount(1, $entities); @@ -514,7 +514,7 @@ public function testCreateManyResolvesToNonEmptyArrayOfEntitiesWhenCountIsBetwee $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\MinimumGenerator() + new Double\Faker\MinimumGenerator(), ); $fixtureFactory->define(Entity\Organization::class); @@ -525,8 +525,8 @@ public function testCreateManyResolvesToNonEmptyArrayOfEntitiesWhenCountIsBetwee Entity\Organization::class, Count::between( $minimum, - $maximum - ) + $maximum, + ), ); self::assertGreaterThanOrEqual(1, \count($entities)); diff --git a/test/Unit/FixtureFactory/UsingWithoutOptionalStrategyTest.php b/test/Unit/FixtureFactory/UsingWithoutOptionalStrategyTest.php index d7470f69..a99bfae8 100644 --- a/test/Unit/FixtureFactory/UsingWithoutOptionalStrategyTest.php +++ b/test/Unit/FixtureFactory/UsingWithoutOptionalStrategyTest.php @@ -44,7 +44,7 @@ public function testCreateOneResolvesOptionalClosureToNullWhenFakerReturnsFalse( { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\FalseGenerator() + new Double\Faker\FalseGenerator(), ); $fixtureFactory->define(Entity\CodeOfConduct::class); @@ -67,7 +67,7 @@ public function testCreateOneResolvesOptionalClosureToNullWhenFakerReturnsTrue() { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\TrueGenerator() + new Double\Faker\TrueGenerator(), ); $fixtureFactory->define(Entity\CodeOfConduct::class); @@ -90,7 +90,7 @@ public function testCreateOneResolvesClosureToResultOfClosureInvokedWithFakerAnd { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\FalseGenerator() + new Double\Faker\FalseGenerator(), ); $fixtureFactory->define(Entity\CodeOfConduct::class); @@ -113,7 +113,7 @@ public function testCreateOneResolvesClosureToResultOfClosureInvokedWithFakerAnd { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\TrueGenerator() + new Double\Faker\TrueGenerator(), ); $fixtureFactory->define(Entity\CodeOfConduct::class); @@ -136,7 +136,7 @@ public function testCreateOneResolvesOptionalReferenceToNullWhenFakerReturnsFals { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\FalseGenerator() + new Double\Faker\FalseGenerator(), ); $fixtureFactory->define(Entity\CodeOfConduct::class); @@ -157,7 +157,7 @@ public function testCreateOneResolvesOptionalReferenceToNullWhenFakerReturnsTrue { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\TrueGenerator() + new Double\Faker\TrueGenerator(), ); $fixtureFactory->define(Entity\CodeOfConduct::class); @@ -178,7 +178,7 @@ public function testCreateOneResolvesReferenceToEntityWhenFakerReturnsFalse(): v { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\FalseGenerator() + new Double\Faker\FalseGenerator(), ); $fixtureFactory->define(Entity\CodeOfConduct::class); @@ -199,7 +199,7 @@ public function testCreateOneResolvesReferenceToEntityWhenFakerReturnsTrue(): vo { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\TrueGenerator() + new Double\Faker\TrueGenerator(), ); $fixtureFactory->define(Entity\CodeOfConduct::class); @@ -223,13 +223,13 @@ public function testCreateOneResolvesReferencesToArrayCollectionOfEntitiesWhenFa { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\FalseGenerator() + new Double\Faker\FalseGenerator(), ); $fixtureFactory->define(Entity\Organization::class, [ 'repositories' => FieldDefinition::references( Entity\Repository::class, - Count::exact($value) + Count::exact($value), ), ]); @@ -253,13 +253,13 @@ public function testCreateOneResolvesReferencesToArrayCollectionOfEntitiesWhenFa { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\TrueGenerator() + new Double\Faker\TrueGenerator(), ); $fixtureFactory->define(Entity\Organization::class, [ 'repositories' => FieldDefinition::references( Entity\Repository::class, - Count::exact($value) + Count::exact($value), ), ]); @@ -287,7 +287,7 @@ public function testCreateOneResolvesReferencesToArrayCollectionOfEntitiesWhenFa $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\FalseGenerator() + new Double\Faker\FalseGenerator(), ); $fixtureFactory->define(Entity\Organization::class, [ @@ -295,8 +295,8 @@ public function testCreateOneResolvesReferencesToArrayCollectionOfEntitiesWhenFa Entity\Repository::class, Count::between( $minimum, - $maximum - ) + $maximum, + ), ), ]); @@ -322,7 +322,7 @@ public function testCreateOneResolvesReferencesToArrayCollectionOfEntitiesWhenFa $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\TrueGenerator() + new Double\Faker\TrueGenerator(), ); $fixtureFactory->define(Entity\Organization::class, [ @@ -330,8 +330,8 @@ public function testCreateOneResolvesReferencesToArrayCollectionOfEntitiesWhenFa Entity\Repository::class, Count::between( $minimum, - $maximum - ) + $maximum, + ), ), ]); @@ -352,7 +352,7 @@ public function testCreateOneResolvesOptionalSequenceNullWhenFakerReturnsFalse() { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\FalseGenerator() + new Double\Faker\FalseGenerator(), ); $fixtureFactory->define(Entity\User::class, [ @@ -379,7 +379,7 @@ public function testCreateOneResolvesOptionalSequenceNullWhenFakerReturnsTrue(): { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\TrueGenerator() + new Double\Faker\TrueGenerator(), ); $fixtureFactory->define(Entity\User::class, [ @@ -406,7 +406,7 @@ public function testCreateOneResolvesSequenceToStringValueWhenPercentDPlaceholde { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\FalseGenerator() + new Double\Faker\FalseGenerator(), ); $fixtureFactory->define(Entity\User::class, [ @@ -433,7 +433,7 @@ public function testCreateOneResolvesSequenceToStringValueWhenPercentDPlaceholde { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\TrueGenerator() + new Double\Faker\TrueGenerator(), ); $fixtureFactory->define(Entity\User::class, [ @@ -463,7 +463,7 @@ public function testCreateManyResolvesToArrayOfEntitiesWhenCountIsExact(int $val { $fixtureFactory = new FixtureFactory( self::entityManager(), - self::faker() + self::faker(), ); $fixtureFactory->define(Entity\Organization::class); @@ -472,7 +472,7 @@ public function testCreateManyResolvesToArrayOfEntitiesWhenCountIsExact(int $val $entities = $withoutOptionalFixtureFactory->createMany( Entity\Organization::class, - Count::exact($value) + Count::exact($value), ); self::assertCount($value, $entities); @@ -487,7 +487,7 @@ public function testCreateManyResolvesToArrayOfEntitiesWhenCountIsBetween(int $m $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\MinimumGenerator() + new Double\Faker\MinimumGenerator(), ); $fixtureFactory->define(Entity\Organization::class); @@ -498,8 +498,8 @@ public function testCreateManyResolvesToArrayOfEntitiesWhenCountIsBetween(int $m Entity\Organization::class, Count::between( $minimum, - $maximum - ) + $maximum, + ), ); self::assertCount($minimum, $entities); diff --git a/test/Unit/FixtureFactoryTest.php b/test/Unit/FixtureFactoryTest.php index 7f3bfe56..b0c493f4 100644 --- a/test/Unit/FixtureFactoryTest.php +++ b/test/Unit/FixtureFactoryTest.php @@ -52,7 +52,7 @@ public function testDefineThrowsEntityDefinitionAlreadyRegisteredExceptionWhenDe { $fixtureFactory = new FixtureFactory( self::entityManager(), - self::faker() + self::faker(), ); $fixtureFactory->define(Entity\Organization::class); @@ -68,7 +68,7 @@ public function testDefineThrowsClassNotFoundExceptionWhenClassDoesNotExist(): v $fixtureFactory = new FixtureFactory( self::entityManager(), - self::faker() + self::faker(), ); $this->expectException(Exception\ClassNotFound::class); @@ -82,7 +82,7 @@ public function testDefineThrowsClassMetadataNotFoundExceptionWhenClassNameDoesN $fixtureFactory = new FixtureFactory( self::entityManager(), - self::faker() + self::faker(), ); $this->expectException(Exception\ClassMetadataNotFound::class); @@ -96,7 +96,7 @@ public function testDefineThrowsInvalidFieldNamesExceptionWhenUsingFieldNamesTha $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $this->expectException(Exception\InvalidFieldNames::class); @@ -112,7 +112,7 @@ public function testLoadRejectsNonExistentDirectory(): void { $fixtureFactory = new FixtureFactory( self::entityManager(), - self::faker() + self::faker(), ); $this->expectException(Exception\InvalidDirectory::class); @@ -124,13 +124,13 @@ public function testLoadThrowsInvalidDefinitionExceptionWhenDefinitionProviderCa { $fixtureFactory = new FixtureFactory( self::entityManager(), - self::faker() + self::faker(), ); $this->expectException(Exception\InvalidDefinition::class); $this->expectExceptionMessage(\sprintf( 'Definition "%s" can not be autoloaded.', - Fixture\DefinitionProvider\CanNotBeAutoloaded\RepositoryDefinitionProviderButCanNotBeAutoloaded::class + Fixture\DefinitionProvider\CanNotBeAutoloaded\RepositoryDefinitionProviderButCanNotBeAutoloaded::class, )); $fixtureFactory->load(__DIR__ . '/../Fixture/DefinitionProvider/CanNotBeAutoloaded'); @@ -140,7 +140,7 @@ public function testLoadIgnoresClassesWhichDoNotImplementDefinitionProviderInter { $fixtureFactory = new FixtureFactory( self::entityManager(), - self::faker() + self::faker(), ); $fixtureFactory->load(__DIR__ . '/../Fixture/DefinitionProvider/DoesNotImplementDefinitionProvider'); @@ -157,7 +157,7 @@ public function testLoadIgnoresClassesWhichImplementDefinitionProviderInterfaceB { $fixtureFactory = new FixtureFactory( self::entityManager(), - self::faker() + self::faker(), ); $fixtureFactory->load(__DIR__ . '/../Fixture/DefinitionProvider/ImplementsDefinitionProviderButIsAbstract'); @@ -174,13 +174,13 @@ public function testLoadThrowsInvalidDefinitionExceptionWhenClassImplementsDefin { $fixtureFactory = new FixtureFactory( self::entityManager(), - self::faker() + self::faker(), ); $this->expectException(Exception\InvalidDefinition::class); $this->expectExceptionMessage(\sprintf( 'Definition "%s" can not be instantiated.', - Fixture\DefinitionProvider\ImplementsDefinitionProviderButCanNotBeInstantiated\RepositoryDefinitionProvider::class + Fixture\DefinitionProvider\ImplementsDefinitionProviderButCanNotBeInstantiated\RepositoryDefinitionProvider::class, )); $fixtureFactory->load(__DIR__ . '/../Fixture/DefinitionProvider/ImplementsDefinitionProviderButCanNotBeInstantiated'); @@ -190,13 +190,13 @@ public function testLoadThrowsInvalidDefinitionExceptionWhenClassImplementsDefin { $fixtureFactory = new FixtureFactory( self::entityManager(), - self::faker() + self::faker(), ); $this->expectException(Exception\InvalidDefinition::class); $this->expectExceptionMessage(\sprintf( 'An exception was thrown while trying to instantiate definition "%s".', - Fixture\DefinitionProvider\ImplementsDefinitionProviderButThrowsExceptionDuringInstantiation\RepositoryDefinitionProvider::class + Fixture\DefinitionProvider\ImplementsDefinitionProviderButThrowsExceptionDuringInstantiation\RepositoryDefinitionProvider::class, )); $fixtureFactory->load(__DIR__ . '/../Fixture/DefinitionProvider/ImplementsDefinitionProviderButThrowsExceptionDuringInstantiation'); @@ -206,7 +206,7 @@ public function testLoadAcceptsClassesWhichImplementDefinitionProviderInterfaceA { $fixtureFactory = new FixtureFactory( self::entityManager(), - self::faker() + self::faker(), ); $fixtureFactory->load(__DIR__ . '/../../example/test/Fixture/Entity'); @@ -226,7 +226,7 @@ public function testCreateOneThrowsEntityDefinitionNotRegisteredWhenEntityDefini $fixtureFactory = new FixtureFactory( self::entityManager(), - self::faker() + self::faker(), ); $this->expectException(Exception\EntityDefinitionNotRegistered::class); @@ -240,7 +240,7 @@ public function testCreateOneThrowsInvalidFieldNamesExceptionWhenReferencingFiel $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fixtureFactory->define(Entity\Organization::class, [ @@ -262,7 +262,7 @@ public function testDefineAllowsDefiningAndReferencingEmbeddables(): void $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fixtureFactory->define(Entity\Avatar::class, [ @@ -289,7 +289,7 @@ public function testDefineThrowsInvalidFieldNamesExceptionWhenReferencingFieldsO $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $this->expectException(Exception\InvalidFieldNames::class); @@ -308,7 +308,7 @@ public function testCreateOneThrowsInvalidFieldNamesExceptionWhenReferencingFiel $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fixtureFactory->define(Entity\User::class); @@ -331,7 +331,7 @@ public function testDefineAcceptsConstantValuesInEntityDefinitions(): void $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fixtureFactory->define(Entity\Organization::class, [ @@ -350,14 +350,14 @@ public function testDefineAcceptsClosureInEntityDefinitions(): void $fixtureFactory = new FixtureFactory( self::entityManager(), - self::faker() + self::faker(), ); $fixtureFactory->define(Entity\Organization::class, [ 'name' => static function () use (&$name): string { return \sprintf( 'the-%s-organization', - $name + $name, ); }, ]); @@ -378,7 +378,7 @@ public function testCreateOneResolvesFieldWithoutDefaultValueToNullWhenFieldDefi { $fixtureFactory = new FixtureFactory( self::entityManager(), - self::faker() + self::faker(), ); $fixtureFactory->define(Entity\Organization::class); @@ -393,7 +393,7 @@ public function testCreateOneResolvesFieldWithDefaultValueToItsDefaultValueWhenF { $fixtureFactory = new FixtureFactory( self::entityManager(), - self::faker() + self::faker(), ); $fixtureFactory->define(Entity\Organization::class); @@ -408,7 +408,7 @@ public function testCreateOneDoesNotInvokeEntityConstructor(): void { $fixtureFactory = new FixtureFactory( self::entityManager(), - self::faker() + self::faker(), ); $fixtureFactory->define(Entity\Organization::class, []); @@ -425,7 +425,7 @@ public function testCreateOneResolvesOneToManyAssociationToEmptyArrayCollectionW $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fixtureFactory->define(Entity\Organization::class, [ @@ -444,7 +444,7 @@ public function testCreateOneMapsArraysToCollectionAssociationFields(): void $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fixtureFactory->define(Entity\Organization::class); @@ -476,7 +476,7 @@ public function testCreateOneEstablishesBidirectionalOneToManyAssociations(): vo { $fixtureFactory = new FixtureFactory( self::entityManager(), - self::faker() + self::faker(), ); $fixtureFactory->define(Entity\Organization::class); @@ -497,7 +497,7 @@ public function testOptionalFieldValuesAreSetToNullWhenFakerReturnsFalse(): void { $fixtureFactory = new FixtureFactory( self::entityManager(), - new Double\Faker\FalseGenerator() + new Double\Faker\FalseGenerator(), ); $fixtureFactory->define( @@ -510,9 +510,9 @@ static function (Entity\User $user, array $fieldValues): void { self::assertArrayHasKey($fieldName, $fieldValues, \sprintf( 'Failed asserting that key for field "%s" exists in field values.', - $fieldName + $fieldName, )); - } + }, ); /** @var Entity\User $user */ @@ -527,7 +527,7 @@ public function testCreateOneAllowsOverridingFieldWithDifferentValueWhenFieldDef $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fixtureFactory->define(Entity\Organization::class, [ @@ -550,7 +550,7 @@ public function testCreateOneAllowsOverridingFieldWithDifferentValueWhenFieldDef $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fixtureFactory->define(Entity\Organization::class, [ @@ -571,13 +571,13 @@ public function testCreateOneAllowsOverridingAssociationWithNullWhenFieldDefinit { $fixtureFactory = new FixtureFactory( self::entityManager(), - self::faker() + self::faker(), ); $fixtureFactory->define(Entity\Repository::class, [ 'template' => FieldDefinition::references( Entity\Repository::class, - Count::between(0, 5) + Count::between(0, 5), ), ]); @@ -593,13 +593,13 @@ public function testCreateOneAllowsOverridingAssociationWithNullWhenFieldDefinit { $fixtureFactory = new FixtureFactory( self::entityManager(), - self::faker() + self::faker(), ); $fixtureFactory->define(Entity\Repository::class, [ 'template' => FieldDefinition::references( Entity\Repository::class, - Count::between(0, 5) + Count::between(0, 5), ), ]); @@ -620,13 +620,13 @@ public function testCreateOneAllowsOverridingAssociationWithCollectionOfEntities $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fixtureFactory->define(Entity\Organization::class, [ 'repositories' => FieldDefinition::references( Entity\Repository::class, - Count::between(0, 5) + Count::between(0, 5), ), ]); @@ -638,7 +638,7 @@ public function testCreateOneAllowsOverridingAssociationWithCollectionOfEntities $organization = $fixtureFactory->createOne(Entity\Organization::class, [ 'repositories' => $fixtureFactory->createMany( Entity\Repository::class, - Count::exact($value) + Count::exact($value), ), ]); @@ -657,13 +657,13 @@ public function testCreateOneAllowsOverridingAssociationWithCollectionOfEntities $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fixtureFactory->define(Entity\Organization::class, [ 'repositories' => FieldDefinition::references( Entity\Repository::class, - Count::between(0, 5) + Count::between(0, 5), ), ]); @@ -675,7 +675,7 @@ public function testCreateOneAllowsOverridingAssociationWithCollectionOfEntities $organization = $fixtureFactory->createOne(Entity\Organization::class, [ 'repositories' => FieldDefinition::references( Entity\Repository::class, - Count::exact($value) + Count::exact($value), ), ]); @@ -693,7 +693,7 @@ public function testDefineAcceptsClosureThatWillBeInvokedAfterEntityCreation(): $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fixtureFactory->define( @@ -706,11 +706,11 @@ static function (Entity\Organization $organization, array $fieldValues, Generato '%s-%s-%d', $organization->name(), $fieldValues['name'], - $faker->numberBetween(10, 99) + $faker->numberBetween(10, 99), ); $organization->renameTo($name); - } + }, ); /** @var Entity\Organization $organization */ @@ -719,7 +719,7 @@ static function (Entity\Organization $organization, array $fieldValues, Generato $expectedPattern = \sprintf( '/^%s-%s-\d{2}$/', $name, - $name + $name, ); $actualName = $organization->name(); @@ -733,7 +733,7 @@ public function testCreateOneCreatesReferencedObjectAutomatically(): void $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fixtureFactory->define(Entity\Organization::class); @@ -761,7 +761,7 @@ public function testCreateOneCreatesReferencedObjectsTransitively(): void { $fixtureFactory = new FixtureFactory( self::entityManager(), - self::faker() + self::faker(), ); $fixtureFactory->define(Entity\Organization::class); @@ -794,14 +794,14 @@ public function testCreateManyThrowsEntityDefinitionNotRegisteredWhenEntityDefin $fixtureFactory = new FixtureFactory( self::entityManager(), - self::faker() + self::faker(), ); $this->expectException(Exception\EntityDefinitionNotRegistered::class); $fixtureFactory->createMany( $className, - Count::exact(3) + Count::exact(3), ); } @@ -811,7 +811,7 @@ public function testCreateManyResolvesToArrayOfEntitiesWhenFieldDefinitionOverri $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $value = $faker->numberBetween(1, 5); @@ -823,7 +823,7 @@ public function testCreateManyResolvesToArrayOfEntitiesWhenFieldDefinitionOverri Count::exact($value), [ 'isVerified' => true, - ] + ], ); self::assertCount($value, $entities); @@ -841,7 +841,7 @@ public function testCreateManyResolvesToArrayOfEntitiesWhenFieldDefinitionOverri $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $value = $faker->numberBetween(1, 5); @@ -853,7 +853,7 @@ public function testCreateManyResolvesToArrayOfEntitiesWhenFieldDefinitionOverri Count::exact($value), [ 'isVerified' => FieldDefinition::value(true), - ] + ], ); self::assertCount($value, $entities); @@ -869,7 +869,7 @@ public function testWithOptionalReturnsMutatedFixtureFactory(): void { $fixtureFactory = new FixtureFactory( self::entityManager(), - self::faker() + self::faker(), ); $withOptionalFixtureFactory = $fixtureFactory->withOptional(); @@ -882,7 +882,7 @@ public function testWitoutOptionalReturnsMutatedFixtureFactory(): void { $fixtureFactory = new FixtureFactory( self::entityManager(), - self::faker() + self::faker(), ); $withoutOptionalFixtureFactory = $fixtureFactory->withoutOptional(); @@ -895,7 +895,7 @@ public function testPersistingReturnsMutatedFixtureFactory(): void { $fixtureFactory = new FixtureFactory( self::entityManager(), - self::faker() + self::faker(), ); $oersistingFixtureFactory = $fixtureFactory->persisting(); diff --git a/test/Unit/Strategy/DefaultStrategyTest.php b/test/Unit/Strategy/DefaultStrategyTest.php index 87bed51d..b3213648 100644 --- a/test/Unit/Strategy/DefaultStrategyTest.php +++ b/test/Unit/Strategy/DefaultStrategyTest.php @@ -39,7 +39,7 @@ public function testResolveFieldValueResolvesOptionalFieldDefinitionWithFakerAnd $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fieldDefinition = FieldDefinition::optionalValue($faker->sentence); @@ -49,12 +49,12 @@ public function testResolveFieldValueResolvesOptionalFieldDefinitionWithFakerAnd $resolved = $strategy->resolveFieldValue( new Double\Faker\TrueGenerator(), $fixtureFactory, - $fieldDefinition + $fieldDefinition, ); $expected = $fieldDefinition->resolve( $faker, - $fixtureFactory + $fixtureFactory, ); self::assertSame($expected, $resolved); @@ -66,7 +66,7 @@ public function testResolveFieldValueResolvesOptionalFieldDefinitionToNullWhenFa $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fieldDefinition = FieldDefinition::optionalValue($faker->sentence); @@ -76,7 +76,7 @@ public function testResolveFieldValueResolvesOptionalFieldDefinitionToNullWhenFa $resolved = $strategy->resolveFieldValue( new Double\Faker\FalseGenerator(), $fixtureFactory, - $fieldDefinition + $fieldDefinition, ); self::assertNull($resolved); @@ -88,7 +88,7 @@ public function testResolveFieldValueResolvesFieldDefinitionWithFakerAndFixtureF $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fieldDefinition = FieldDefinition::value($faker->sentence); @@ -98,12 +98,12 @@ public function testResolveFieldValueResolvesFieldDefinitionWithFakerAndFixtureF $resolved = $strategy->resolveFieldValue( new Double\Faker\TrueGenerator(), $fixtureFactory, - $fieldDefinition + $fieldDefinition, ); $expected = $fieldDefinition->resolve( $faker, - $fixtureFactory + $fixtureFactory, ); self::assertSame($expected, $resolved); @@ -115,7 +115,7 @@ public function testResolveFieldValueResolvesFieldDefinitionWithFakerAndFixtureF $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fieldDefinition = FieldDefinition::value($faker->sentence); @@ -125,12 +125,12 @@ public function testResolveFieldValueResolvesFieldDefinitionWithFakerAndFixtureF $resolved = $strategy->resolveFieldValue( new Double\Faker\FalseGenerator(), $fixtureFactory, - $fieldDefinition + $fieldDefinition, ); $expected = $fieldDefinition->resolve( $faker, - $fixtureFactory + $fixtureFactory, ); self::assertSame($expected, $resolved); @@ -145,7 +145,7 @@ public function testResolveCountResolvesCountWithFakerWhenCountIsExact(int $valu $resolved = $strategy->resolveCount( self::faker(), - Count::exact($value) + Count::exact($value), ); self::assertSame($value, $resolved); @@ -164,8 +164,8 @@ public function testResolveCountResolvesCountWithFakerWhenCountIsBetweenAndFaker new Double\Faker\MinimumGenerator(), Count::between( $minimum, - $maximum - ) + $maximum, + ), ); self::assertSame($minimum, $resolved); @@ -184,8 +184,8 @@ public function testResolveCountResolvesCountWithFakerWhenCountIsBetweenAndFaker new Double\Faker\MaximumGenerator(), Count::between( $minimum, - $maximum - ) + $maximum, + ), ); self::assertSame($maximum, $resolved); @@ -204,8 +204,8 @@ public function testResolveCountResolvesCountWithFakerWhenCountIsBetween(): void $faker, Count::between( $minimum, - $maximum - ) + $maximum, + ), ); self::assertGreaterThanOrEqual($minimum, $resolved); diff --git a/test/Unit/Strategy/WithOptionalStrategyTest.php b/test/Unit/Strategy/WithOptionalStrategyTest.php index 8be08aa5..a4f3a40e 100644 --- a/test/Unit/Strategy/WithOptionalStrategyTest.php +++ b/test/Unit/Strategy/WithOptionalStrategyTest.php @@ -39,7 +39,7 @@ public function testResolveFieldValueResolvesOptionalFieldDefinitionWithFakerAnd $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fieldDefinition = FieldDefinition::optionalValue($faker->sentence); @@ -49,12 +49,12 @@ public function testResolveFieldValueResolvesOptionalFieldDefinitionWithFakerAnd $resolved = $strategy->resolveFieldValue( new Double\Faker\TrueGenerator(), $fixtureFactory, - $fieldDefinition + $fieldDefinition, ); $expected = $fieldDefinition->resolve( $faker, - $fixtureFactory + $fixtureFactory, ); self::assertSame($expected, $resolved); @@ -66,7 +66,7 @@ public function testResolveFieldValueResolvesOptionalFieldDefinitionWithFakerAnd $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fieldDefinition = FieldDefinition::optionalValue($faker->sentence); @@ -76,12 +76,12 @@ public function testResolveFieldValueResolvesOptionalFieldDefinitionWithFakerAnd $resolved = $strategy->resolveFieldValue( new Double\Faker\FalseGenerator(), $fixtureFactory, - $fieldDefinition + $fieldDefinition, ); $expected = $fieldDefinition->resolve( $faker, - $fixtureFactory + $fixtureFactory, ); self::assertSame($expected, $resolved); @@ -93,7 +93,7 @@ public function testResolveFieldValueResolvesFieldDefinitionWithFakerAndFixtureF $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fieldDefinition = FieldDefinition::value($faker->sentence); @@ -103,12 +103,12 @@ public function testResolveFieldValueResolvesFieldDefinitionWithFakerAndFixtureF $resolved = $strategy->resolveFieldValue( new Double\Faker\TrueGenerator(), $fixtureFactory, - $fieldDefinition + $fieldDefinition, ); $expected = $fieldDefinition->resolve( $faker, - $fixtureFactory + $fixtureFactory, ); self::assertSame($expected, $resolved); @@ -120,7 +120,7 @@ public function testResolveFieldValueResolvesFieldDefinitionWithFakerAndFixtureF $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fieldDefinition = FieldDefinition::value($faker->sentence); @@ -130,12 +130,12 @@ public function testResolveFieldValueResolvesFieldDefinitionWithFakerAndFixtureF $resolved = $strategy->resolveFieldValue( new Double\Faker\FalseGenerator(), $fixtureFactory, - $fieldDefinition + $fieldDefinition, ); $expected = $fieldDefinition->resolve( $faker, - $fixtureFactory + $fixtureFactory, ); self::assertSame($expected, $resolved); @@ -152,7 +152,7 @@ public function testResolveCountResolvesCountWithFakerWhenCountIsExact(int $valu $resolved = $strategy->resolveCount( $faker, - Count::exact($value) + Count::exact($value), ); self::assertSame($value, $resolved); @@ -171,13 +171,13 @@ public function testResolveCountResolvesCountWithFakerWhenCountIsBetweenAndFaker new Double\Faker\MinimumGenerator(), Count::between( $minimum, - $maximum - ) + $maximum, + ), ); $minimumGreaterThanZero = \max( 1, - $minimum + $minimum, ); self::assertSame($minimumGreaterThanZero, $resolved); @@ -196,8 +196,8 @@ public function testResolveCountResolvesCountWithFakerWhenCountIsBetweenAndFaker new Double\Faker\MaximumGenerator(), Count::between( $minimum, - $maximum - ) + $maximum, + ), ); self::assertSame($maximum, $resolved); @@ -216,13 +216,13 @@ public function testResolveCountResolvesCountWithFakerWhenCountIsBetween(): void $faker, Count::between( $minimum, - $maximum - ) + $maximum, + ), ); $minimumGreaterThanZero = \max( 1, - $minimum + $minimum, ); self::assertGreaterThanOrEqual($minimumGreaterThanZero, $resolved); diff --git a/test/Unit/Strategy/WithoutOptionalStrategyTest.php b/test/Unit/Strategy/WithoutOptionalStrategyTest.php index ee3299fd..8c4df6f6 100644 --- a/test/Unit/Strategy/WithoutOptionalStrategyTest.php +++ b/test/Unit/Strategy/WithoutOptionalStrategyTest.php @@ -39,7 +39,7 @@ public function testResolveFieldValueResolvesOptionalFieldDefinitionToNullWhenFa $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fieldDefinition = FieldDefinition::optionalValue($faker->sentence); @@ -49,7 +49,7 @@ public function testResolveFieldValueResolvesOptionalFieldDefinitionToNullWhenFa $resolved = $strategy->resolveFieldValue( new Double\Faker\TrueGenerator(), $fixtureFactory, - $fieldDefinition + $fieldDefinition, ); self::assertNull($resolved); @@ -61,7 +61,7 @@ public function testResolveFieldValueResolvesOptionalFieldDefinitionToNullWhenFa $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fieldDefinition = FieldDefinition::optionalValue($faker->sentence); @@ -71,7 +71,7 @@ public function testResolveFieldValueResolvesOptionalFieldDefinitionToNullWhenFa $resolved = $strategy->resolveFieldValue( new Double\Faker\FalseGenerator(), $fixtureFactory, - $fieldDefinition + $fieldDefinition, ); self::assertNull($resolved); @@ -83,7 +83,7 @@ public function testResolveFieldValueResolvesFieldDefinitionWithFakerAndFixtureF $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fieldDefinition = FieldDefinition::value($faker->sentence); @@ -93,12 +93,12 @@ public function testResolveFieldValueResolvesFieldDefinitionWithFakerAndFixtureF $resolved = $strategy->resolveFieldValue( new Double\Faker\TrueGenerator(), $fixtureFactory, - $fieldDefinition + $fieldDefinition, ); $expected = $fieldDefinition->resolve( $faker, - $fixtureFactory + $fixtureFactory, ); self::assertSame($expected, $resolved); @@ -110,7 +110,7 @@ public function testResolveFieldValueResolvesFieldDefinitionWithoutFakerAndFixtu $fixtureFactory = new FixtureFactory( self::entityManager(), - $faker + $faker, ); $fieldDefinition = FieldDefinition::value($faker->sentence); @@ -120,12 +120,12 @@ public function testResolveFieldValueResolvesFieldDefinitionWithoutFakerAndFixtu $resolved = $strategy->resolveFieldValue( new Double\Faker\FalseGenerator(), $fixtureFactory, - $fieldDefinition + $fieldDefinition, ); $expected = $fieldDefinition->resolve( $faker, - $fixtureFactory + $fixtureFactory, ); self::assertSame($expected, $resolved); @@ -142,7 +142,7 @@ public function testResolveCountResolvesCountToValueWhenCountIsExact(int $value) $resolved = $strategy->resolveCount( $faker, - Count::exact($value) + Count::exact($value), ); self::assertSame($value, $resolved); @@ -163,8 +163,8 @@ public function testResolveCountResolvesCountToMininumWhenCountIsBetween(int $mi $faker, Count::between( $minimum, - $maximum - ) + $maximum, + ), ); self::assertSame($minimum, $resolved); diff --git a/test/Util/Doctrine/ORM/EntityManagerFactory.php b/test/Util/Doctrine/ORM/EntityManagerFactory.php index 68d10011..ef6d758c 100644 --- a/test/Util/Doctrine/ORM/EntityManagerFactory.php +++ b/test/Util/Doctrine/ORM/EntityManagerFactory.php @@ -26,7 +26,7 @@ public static function create(): ORM\EntityManagerInterface true, null, null, - false + false, ); return ORM\EntityManager::create( @@ -34,7 +34,7 @@ public static function create(): ORM\EntityManagerInterface 'driver' => 'pdo_sqlite', 'path' => ':memory:', ], - $configuration + $configuration, ); } }