From e4341676162c13a5e653d6d1d050b9e768a256ea Mon Sep 17 00:00:00 2001 From: Jan Goralski Date: Tue, 23 Apr 2024 10:04:04 +0200 Subject: [PATCH 1/6] [Maintenance] Allow installing Symfony 7 --- .github/workflows/build.yml | 21 +++++++++++++++++---- composer.json | 12 ++++++------ easy-coding-standard.yml | 17 ----------------- ecs.php | 5 ++--- 4 files changed, 25 insertions(+), 30 deletions(-) delete mode 100644 easy-coding-standard.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3c6e68d..ab834d2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,13 +17,26 @@ jobs: strategy: fail-fast: false matrix: - php: ["8.0", "8.1"] - symfony: ["^5.4", "^6.0"] + php: ["8.0", "8.1", "8.2"] + symfony: ["^5.4", "^6.4", "^7.0"] dbal: ["^2.0", "^3.0"] + exclude: + - + php: "8.0" + symfony: "^6.4" + - + php: "8.0" + symfony: "^7.0" + - + php: "8.1" + symfony: "^7.0" + - + symfony: "^7.0" + dbal: "^2.0" steps: - - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup PHP @@ -37,7 +50,7 @@ jobs: if: matrix.symfony != '' run: | composer global config --no-plugins allow-plugins.symfony/flex true - composer global require --no-progress --no-scripts --no-plugins "symfony/flex:1.18.5" + composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.17 || ^2.0" composer config extra.symfony.require "${{ matrix.symfony }}" - diff --git a/composer.json b/composer.json index 3200e51..8bced99 100644 --- a/composer.json +++ b/composer.json @@ -26,16 +26,16 @@ "require": { "php": "^8.0", "doctrine/data-fixtures": "^1.2", - "monolog/monolog": "^1.25 || ^2.1", - "symfony/framework-bundle": "^5.4 || ^6.0", - "symfony/monolog-bridge": "^5.4 || ^6.0", + "monolog/monolog": "^1.25 || ^2.1 || ^3", + "symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0", + "symfony/monolog-bridge": "^5.4 || ^6.0 || ^7.0", "webmozart/assert": "^1.9" }, "require-dev": { "doctrine/doctrine-bundle": "^2.1", - "doctrine/orm": "^2.7", - "matthiasnoback/symfony-config-test": "^4.2", - "matthiasnoback/symfony-dependency-injection-test": "^4.2", + "doctrine/orm": "^2.7 || ^3.0", + "matthiasnoback/symfony-config-test": "^4.2 || ^5.0", + "matthiasnoback/symfony-dependency-injection-test": "^4.2 || ^5.0", "phpspec/phpspec": "^7.0", "phpunit/phpunit": "^9.4", "sylius-labs/coding-standard": "^4.0", diff --git a/easy-coding-standard.yml b/easy-coding-standard.yml deleted file mode 100644 index cdb009c..0000000 --- a/easy-coding-standard.yml +++ /dev/null @@ -1,17 +0,0 @@ -imports: - - { resource: 'vendor/sylius-labs/coding-standard/easy-coding-standard.yml' } - -parameters: - exclude_files: - - '**/var/*' - -services: - PhpCsFixer\Fixer\Comment\HeaderCommentFixer: - header: | - This file is part of the Sylius package. - - (c) Paweł Jędrzejewski - - For the full copyright and license information, please view the LICENSE - file that was distributed with this source code. - location: 'after_open' diff --git a/ecs.php b/ecs.php index 1b77170..42ac190 100644 --- a/ecs.php +++ b/ecs.php @@ -2,12 +2,11 @@ use PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer; use PhpCsFixer\Fixer\Comment\HeaderCommentFixer; -use PhpCsFixer\Fixer\Phpdoc\PhpdocTagTypeFixer; use SlevomatCodingStandard\Sniffs\Commenting\InlineDocCommentDeclarationSniff; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\Config\ECSConfig; use Symplify\EasyCodingStandard\ValueObject\Option; -return static function (ContainerConfigurator $containerConfigurator): void +return static function (ECSConfig $containerConfigurator): void { $containerConfigurator->import('vendor/sylius-labs/coding-standard/ecs.php'); From 10b1610002ad962af281946b654dcfde906dbd3b Mon Sep 17 00:00:00 2001 From: Jan Goralski Date: Tue, 23 Apr 2024 10:38:15 +0200 Subject: [PATCH 2/6] [Maintenance] Update ecs config --- composer.json | 2 +- ecs.php | 36 +++++++++++++++++++++--------------- src/Suite/PriorityQueue.php | 1 - 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/composer.json b/composer.json index 8bced99..d898ec0 100644 --- a/composer.json +++ b/composer.json @@ -61,7 +61,7 @@ "scripts": { "analyse": [ "@composer validate --strict", - "vendor/bin/ecs check spec src tests", + "vendor/bin/ecs check", "vendor/bin/psalm" ], "fix": [ diff --git a/ecs.php b/ecs.php index 42ac190..4b9bd2e 100644 --- a/ecs.php +++ b/ecs.php @@ -4,26 +4,32 @@ use PhpCsFixer\Fixer\Comment\HeaderCommentFixer; use SlevomatCodingStandard\Sniffs\Commenting\InlineDocCommentDeclarationSniff; use Symplify\EasyCodingStandard\Config\ECSConfig; -use Symplify\EasyCodingStandard\ValueObject\Option; -return static function (ECSConfig $containerConfigurator): void -{ - $containerConfigurator->import('vendor/sylius-labs/coding-standard/ecs.php'); +return static function (ECSConfig $config): void { + $config->import('vendor/sylius-labs/coding-standard/ecs.php'); - $containerConfigurator->services()->set(HeaderCommentFixer::class)->call('configure', [[ - 'location' => 'after_open', - 'header' => - 'This file is part of the Sylius package. + $config->parallel(); + $config->paths(['src', 'spec', 'tests']); -(c) Paweł Jędrzejewski - -For the full copyright and license information, please view the LICENSE -file that was distributed with this source code.', - ]]); - - $containerConfigurator->parameters()->set(Option::SKIP, [ + $config->skip([ InlineDocCommentDeclarationSniff::class . '.MissingVariable', VisibilityRequiredFixer::class => ['*Spec.php'], '**/var/*', ]); + + $config->ruleWithConfiguration( + HeaderCommentFixer::class, + [ + 'location' => 'after_open', + 'comment_type' => HeaderCommentFixer::HEADER_COMMENT, + 'header' => << - * * @var array[] */ private array $records = []; From 10d64fdca60104882a6b20de0596479a7008d8d3 Mon Sep 17 00:00:00 2001 From: Jan Goralski Date: Tue, 23 Apr 2024 12:50:25 +0200 Subject: [PATCH 3/6] [Maintenance] Swap psalm for phpstan --- composer.json | 10 ++++--- phpstan.neon.dist | 26 +++++++++++++++++++ psalm.xml | 17 ------------ .../SyliusFixturesExtension.php | 3 +++ src/Fixture/FixtureInterface.php | 1 + src/Fixture/FixtureRegistry.php | 4 +-- .../AfterFixtureListenerInterface.php | 1 + src/Listener/AfterSuiteListenerInterface.php | 1 + .../BeforeFixtureListenerInterface.php | 1 + src/Listener/BeforeSuiteListenerInterface.php | 1 + src/Listener/FixtureEvent.php | 6 +++-- src/Listener/ListenerRegistry.php | 4 +-- src/Listener/ListenerRegistryInterface.php | 2 +- src/Listener/LoggerListener.php | 2 ++ src/Listener/MongoDBPurgerListener.php | 6 ++--- src/Listener/ORMPurgerListener.php | 4 ++- src/Listener/PHPCRPurgerListener.php | 6 ++--- src/Listener/SuiteLoaderListener.php | 1 + src/Loader/FixtureLoaderInterface.php | 1 + src/Loader/SuiteLoader.php | 1 - src/Suite/LazySuiteRegistry.php | 3 +++ src/Suite/PriorityQueue.php | 11 ++++---- src/Suite/Suite.php | 3 +++ src/Suite/SuiteFactory.php | 2 ++ src/Suite/SuiteFactoryInterface.php | 1 + src/Suite/SuiteInterface.php | 4 +-- .../SyliusFixturesExtensionTest.php | 4 +-- tests/Listener/MongoDBPurgerListenerTest.php | 2 +- tests/Listener/PHPCRPurgerListenerTest.php | 7 +++-- tests/Loader/FixtureListCommandTest.php | 5 ++++ tests/Loader/FixtureLoaderTest.php | 8 ++++-- tests/Loader/SampleFixture.php | 9 ++++--- 32 files changed, 105 insertions(+), 52 deletions(-) create mode 100644 phpstan.neon.dist delete mode 100644 psalm.xml diff --git a/composer.json b/composer.json index d898ec0..85ff0b0 100644 --- a/composer.json +++ b/composer.json @@ -39,8 +39,12 @@ "phpspec/phpspec": "^7.0", "phpunit/phpunit": "^9.4", "sylius-labs/coding-standard": "^4.0", - "vimeo/psalm": "^4.23", - "rector/rector": "^0.14.5" + "rector/rector": "^0.14.5", + "phpstan/phpstan": "^1.10", + "phpstan/phpstan-doctrine": "^1.3", + "phpstan/phpstan-webmozart-assert": "^1.2", + "phpstan/phpstan-symfony": "^1.3", + "phpstan/phpstan-phpunit": "^1.3" }, "extra": { "branch-alias": { @@ -62,7 +66,7 @@ "analyse": [ "@composer validate --strict", "vendor/bin/ecs check", - "vendor/bin/psalm" + "vendor/bin/phpstan analyse" ], "fix": [ "vendor/bin/ecs check spec src tests --fix" diff --git a/phpstan.neon.dist b/phpstan.neon.dist new file mode 100644 index 0000000..7e62a7a --- /dev/null +++ b/phpstan.neon.dist @@ -0,0 +1,26 @@ +includes: + - vendor/phpstan/phpstan-doctrine/extension.neon + - vendor/phpstan/phpstan-doctrine/rules.neon + - vendor/phpstan/phpstan-phpunit/extension.neon + - vendor/phpstan/phpstan-phpunit/rules.neon + - vendor/phpstan/phpstan-symfony/extension.neon + - vendor/phpstan/phpstan-symfony/rules.neon + - vendor/phpstan/phpstan-webmozart-assert/extension.neon + +parameters: + level: 6 + + reportUnmatchedIgnoredErrors: false + + paths: + - 'src/' + - 'tests/' + + excludePaths: + - 'tests/Application/**.php' + + ignoreErrors: + - '/Property .*\:\:\$container has no type specified\./' + - '/Static property .*\:\:\$container \(.*\\Test\\TestContainer\) does not accept Symfony\\Component\\DependencyInjection\\ContainerInterface\./' + - '/PHPDoc tag \@var for variable \$manager contains unknown class Doctrine\\ODM\\MongoDB\\DocumentManager\./' + - '/PHPDoc tag \@var for variable \$manager contains unknown class Doctrine\\ODM\\PHPCR\\DocumentManagerInterface\./' diff --git a/psalm.xml b/psalm.xml deleted file mode 100644 index 3f29b72..0000000 --- a/psalm.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - diff --git a/src/DependencyInjection/SyliusFixturesExtension.php b/src/DependencyInjection/SyliusFixturesExtension.php index 89e273a..da28a6b 100644 --- a/src/DependencyInjection/SyliusFixturesExtension.php +++ b/src/DependencyInjection/SyliusFixturesExtension.php @@ -26,11 +26,13 @@ final class SyliusFixturesExtension extends Extension implements PrependExtensionInterface { + /** @param array $config */ public function getConfiguration(array $config, ContainerBuilder $container): ConfigurationInterface { return new Configuration(); } + /** @param array> $configs */ public function load(array $configs, ContainerBuilder $container): void { $config = $this->processConfiguration($this->getConfiguration([], $container), $configs); @@ -69,6 +71,7 @@ public function prepend(ContainerBuilder $container): void } } + /** @param array{suites: array>} $config */ private function registerSuites(array $config, ContainerBuilder $container): void { $suiteRegistry = $container->findDefinition('sylius_fixtures.suite_registry'); diff --git a/src/Fixture/FixtureInterface.php b/src/Fixture/FixtureInterface.php index fa14deb..51ccb1f 100644 --- a/src/Fixture/FixtureInterface.php +++ b/src/Fixture/FixtureInterface.php @@ -17,6 +17,7 @@ interface FixtureInterface extends ConfigurationInterface { + /** @param array $options */ public function load(array $options): void; public function getName(): string; diff --git a/src/Fixture/FixtureRegistry.php b/src/Fixture/FixtureRegistry.php index 5f9d3fd..0b8eb90 100644 --- a/src/Fixture/FixtureRegistry.php +++ b/src/Fixture/FixtureRegistry.php @@ -17,8 +17,8 @@ final class FixtureRegistry implements FixtureRegistryInterface { - /** @var array */ - private $fixtures = []; + /** @var array */ + private array $fixtures = []; public function addFixture(FixtureInterface $fixture): void { diff --git a/src/Listener/AfterFixtureListenerInterface.php b/src/Listener/AfterFixtureListenerInterface.php index db324cf..97878d6 100644 --- a/src/Listener/AfterFixtureListenerInterface.php +++ b/src/Listener/AfterFixtureListenerInterface.php @@ -15,5 +15,6 @@ interface AfterFixtureListenerInterface extends ListenerInterface { + /** @param array $options */ public function afterFixture(FixtureEvent $fixtureEvent, array $options): void; } diff --git a/src/Listener/AfterSuiteListenerInterface.php b/src/Listener/AfterSuiteListenerInterface.php index 54c3e47..9c5428d 100644 --- a/src/Listener/AfterSuiteListenerInterface.php +++ b/src/Listener/AfterSuiteListenerInterface.php @@ -15,5 +15,6 @@ interface AfterSuiteListenerInterface extends ListenerInterface { + /** @param array $options */ public function afterSuite(SuiteEvent $suiteEvent, array $options): void; } diff --git a/src/Listener/BeforeFixtureListenerInterface.php b/src/Listener/BeforeFixtureListenerInterface.php index 7012c70..225163e 100644 --- a/src/Listener/BeforeFixtureListenerInterface.php +++ b/src/Listener/BeforeFixtureListenerInterface.php @@ -15,5 +15,6 @@ interface BeforeFixtureListenerInterface extends ListenerInterface { + /** @param array $options */ public function beforeFixture(FixtureEvent $fixtureEvent, array $options): void; } diff --git a/src/Listener/BeforeSuiteListenerInterface.php b/src/Listener/BeforeSuiteListenerInterface.php index fa29b95..0a84a0a 100644 --- a/src/Listener/BeforeSuiteListenerInterface.php +++ b/src/Listener/BeforeSuiteListenerInterface.php @@ -15,5 +15,6 @@ interface BeforeSuiteListenerInterface extends ListenerInterface { + /** @param array $options */ public function beforeSuite(SuiteEvent $suiteEvent, array $options): void; } diff --git a/src/Listener/FixtureEvent.php b/src/Listener/FixtureEvent.php index 6fb61e5..b6e6df2 100644 --- a/src/Listener/FixtureEvent.php +++ b/src/Listener/FixtureEvent.php @@ -22,9 +22,10 @@ final class FixtureEvent private FixtureInterface $fixture; - /** @var array */ - private $fixtureOptions; + /** @var array */ + private array $fixtureOptions; + /** @param array $fixtureOptions */ public function __construct(SuiteInterface $suite, FixtureInterface $fixture, array $fixtureOptions) { $this->suite = $suite; @@ -42,6 +43,7 @@ public function fixture(): FixtureInterface return $this->fixture; } + /** @return array */ public function fixtureOptions(): array { return $this->fixtureOptions; diff --git a/src/Listener/ListenerRegistry.php b/src/Listener/ListenerRegistry.php index 9cb4f6f..63744a2 100644 --- a/src/Listener/ListenerRegistry.php +++ b/src/Listener/ListenerRegistry.php @@ -17,8 +17,8 @@ final class ListenerRegistry implements ListenerRegistryInterface { - /** @var array */ - private $listeners = []; + /** @var array */ + private array $listeners = []; public function addListener(ListenerInterface $listener): void { diff --git a/src/Listener/ListenerRegistryInterface.php b/src/Listener/ListenerRegistryInterface.php index 17f45af..08b8576 100644 --- a/src/Listener/ListenerRegistryInterface.php +++ b/src/Listener/ListenerRegistryInterface.php @@ -21,7 +21,7 @@ interface ListenerRegistryInterface public function getListener(string $name): ListenerInterface; /** - * @return array|ListenerInterface[] Name indexed + * @return array Name indexed */ public function getListeners(): array; } diff --git a/src/Listener/LoggerListener.php b/src/Listener/LoggerListener.php index 2590693..b82f1b8 100644 --- a/src/Listener/LoggerListener.php +++ b/src/Listener/LoggerListener.php @@ -24,11 +24,13 @@ public function __construct(LoggerInterface $logger) $this->logger = $logger; } + /** @param array $options */ public function beforeSuite(SuiteEvent $suiteEvent, array $options): void { $this->logger->notice(sprintf('Running suite "%s"...', $suiteEvent->suite()->getName())); } + /** @param array $options */ public function beforeFixture(FixtureEvent $fixtureEvent, array $options): void { $this->logger->notice(sprintf('Running fixture "%s"...', $fixtureEvent->fixture()->getName())); diff --git a/src/Listener/MongoDBPurgerListener.php b/src/Listener/MongoDBPurgerListener.php index 6ca2ce2..fd690b6 100644 --- a/src/Listener/MongoDBPurgerListener.php +++ b/src/Listener/MongoDBPurgerListener.php @@ -14,20 +14,20 @@ namespace Sylius\Bundle\FixturesBundle\Listener; use Doctrine\Common\DataFixtures\Purger\MongoDBPurger; -use Doctrine\Common\Persistence\ManagerRegistry; use Doctrine\ODM\MongoDB\DocumentManager; +use Doctrine\Persistence\ManagerRegistry; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; final class MongoDBPurgerListener extends AbstractListener implements BeforeSuiteListenerInterface { - /** @var ManagerRegistry */ - private $managerRegistry; + private ManagerRegistry $managerRegistry; public function __construct(ManagerRegistry $managerRegistry) { $this->managerRegistry = $managerRegistry; } + /** @param array{managers: string[]} $options */ public function beforeSuite(SuiteEvent $suiteEvent, array $options): void { foreach ($options['managers'] as $managerName) { diff --git a/src/Listener/ORMPurgerListener.php b/src/Listener/ORMPurgerListener.php index 4c06eb4..e0d027e 100644 --- a/src/Listener/ORMPurgerListener.php +++ b/src/Listener/ORMPurgerListener.php @@ -22,6 +22,7 @@ final class ORMPurgerListener extends AbstractListener implements BeforeSuiteLis { private ManagerRegistry $managerRegistry; + /** @var array */ private static array $purgeModes = [ 'delete' => ORMPurger::PURGE_MODE_DELETE, 'truncate' => ORMPurger::PURGE_MODE_TRUNCATE, @@ -32,6 +33,7 @@ public function __construct(ManagerRegistry $managerRegistry) $this->managerRegistry = $managerRegistry; } + /** @param array{managers: string[], exclude: array, mode: string} $options */ public function beforeSuite(SuiteEvent $suiteEvent, array $options): void { foreach ($options['managers'] as $managerName) { @@ -39,7 +41,7 @@ public function beforeSuite(SuiteEvent $suiteEvent, array $options): void $manager = $this->managerRegistry->getManager($managerName); $purger = new ORMPurger($manager, $options['exclude']); - $purger->setPurgeMode(static::$purgeModes[$options['mode']]); + $purger->setPurgeMode(self::$purgeModes[$options['mode']]); $purger->purge(); } } diff --git a/src/Listener/PHPCRPurgerListener.php b/src/Listener/PHPCRPurgerListener.php index 2470e8f..7333e37 100644 --- a/src/Listener/PHPCRPurgerListener.php +++ b/src/Listener/PHPCRPurgerListener.php @@ -14,20 +14,20 @@ namespace Sylius\Bundle\FixturesBundle\Listener; use Doctrine\Common\DataFixtures\Purger\PHPCRPurger; -use Doctrine\Common\Persistence\ManagerRegistry; use Doctrine\ODM\PHPCR\DocumentManagerInterface; +use Doctrine\Persistence\ManagerRegistry; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; final class PHPCRPurgerListener extends AbstractListener implements BeforeSuiteListenerInterface { - /** @var ManagerRegistry */ - private $managerRegistry; + private ManagerRegistry $managerRegistry; public function __construct(ManagerRegistry $managerRegistry) { $this->managerRegistry = $managerRegistry; } + /** @param array{managers: string[]} $options */ public function beforeSuite(SuiteEvent $suiteEvent, array $options): void { foreach ($options['managers'] as $managerName) { diff --git a/src/Listener/SuiteLoaderListener.php b/src/Listener/SuiteLoaderListener.php index 2c7f21a..af3e5ad 100644 --- a/src/Listener/SuiteLoaderListener.php +++ b/src/Listener/SuiteLoaderListener.php @@ -34,6 +34,7 @@ public function getName(): string return 'suite_loader'; } + /** @param array{suites: string[]} $options */ public function beforeSuite(SuiteEvent $suiteEvent, array $options): void { foreach ($options['suites'] as $suiteName) { diff --git a/src/Loader/FixtureLoaderInterface.php b/src/Loader/FixtureLoaderInterface.php index 497dda0..df1a317 100644 --- a/src/Loader/FixtureLoaderInterface.php +++ b/src/Loader/FixtureLoaderInterface.php @@ -18,5 +18,6 @@ interface FixtureLoaderInterface { + /** @param array $options */ public function load(SuiteInterface $suite, FixtureInterface $fixture, array $options): void; } diff --git a/src/Loader/SuiteLoader.php b/src/Loader/SuiteLoader.php index c8e771a..f3426ac 100644 --- a/src/Loader/SuiteLoader.php +++ b/src/Loader/SuiteLoader.php @@ -28,7 +28,6 @@ public function __construct(FixtureLoaderInterface $fixtureLoader) public function load(SuiteInterface $suite): void { /** @var FixtureInterface $fixture */ - /** @var array $fixtureOptions */ foreach ($suite->getFixtures() as $fixture => $fixtureOptions) { $this->fixtureLoader->load($suite, $fixture, $fixtureOptions); } diff --git a/src/Suite/LazySuiteRegistry.php b/src/Suite/LazySuiteRegistry.php index 9c4c8c6..dece4c3 100644 --- a/src/Suite/LazySuiteRegistry.php +++ b/src/Suite/LazySuiteRegistry.php @@ -17,8 +17,10 @@ final class LazySuiteRegistry implements SuiteRegistryInterface { private SuiteFactoryInterface $suiteFactory; + /** @var array> */ private array $suiteDefinitions = []; + /** @var array> */ private array $suites = []; public function __construct(SuiteFactoryInterface $suiteFactory) @@ -26,6 +28,7 @@ public function __construct(SuiteFactoryInterface $suiteFactory) $this->suiteFactory = $suiteFactory; } + /** @param array $configuration */ public function addSuite(string $name, array $configuration): void { $this->suiteDefinitions[$name] = $configuration; diff --git a/src/Suite/PriorityQueue.php b/src/Suite/PriorityQueue.php index f3d8327..afe8186 100644 --- a/src/Suite/PriorityQueue.php +++ b/src/Suite/PriorityQueue.php @@ -15,28 +15,29 @@ /** * @internal + * + * @implements \IteratorAggregate> */ final class PriorityQueue implements \IteratorAggregate { - /** - * @psalm-var array - * @var array[] - */ + /** @var array, priority: int}> */ private array $records = []; private bool $sorted = false; + /** @param array $data */ public function insert(array $data, int $priority = 0): void { $this->records[] = ['priority' => $priority, 'data' => $data]; $this->sorted = false; } + /** @return \Traversable> */ public function getIterator(): \Traversable { if ($this->sorted === false) { - /** @psalm-suppress InvalidPassByReference Doing PHP magic, it works this way */ array_multisort( + /** @phpstan-ignore-next-line Doing PHP magic, it works this way */ array_column($this->records, 'priority'), \SORT_DESC, array_keys($this->records), diff --git a/src/Suite/Suite.php b/src/Suite/Suite.php index 85f4671..3ca381e 100644 --- a/src/Suite/Suite.php +++ b/src/Suite/Suite.php @@ -31,11 +31,13 @@ public function __construct(string $name) $this->listeners = new PriorityQueue(); } + /** @param array $options */ public function addFixture(FixtureInterface $fixture, array $options, int $priority = 0): void { $this->fixtures->insert(['fixture' => $fixture, 'options' => $options], $priority); } + /** @param array $options */ public function addListener(ListenerInterface $listener, array $options, int $priority = 0): void { $this->listeners->insert(['listener' => $listener, 'options' => $options], $priority); @@ -46,6 +48,7 @@ public function getName(): string return $this->name; } + /** @returns */ public function getFixtures(): iterable { foreach ($this->fixtures as $fixture) { diff --git a/src/Suite/SuiteFactory.php b/src/Suite/SuiteFactory.php index 7b58d06..765cb5d 100644 --- a/src/Suite/SuiteFactory.php +++ b/src/Suite/SuiteFactory.php @@ -54,6 +54,7 @@ public function createSuite(string $name, array $configuration): SuiteInterface return $suite; } + /** @param array{name: string, options: array, priority: ?int} $fixtureAttributes */ private function addFixtureToSuite(Suite $suite, string $fixtureAlias, array $fixtureAttributes): void { Assert::keyExists($fixtureAttributes, 'name'); @@ -66,6 +67,7 @@ private function addFixtureToSuite(Suite $suite, string $fixtureAlias, array $fi $suite->addFixture($fixture, $fixtureOptions, $fixturePriority); } + /** @param array{name: string, options: array, priority: ?int} $listenerAttributes */ private function addListenerToSuite(Suite $suite, string $listenerName, array $listenerAttributes): void { Assert::keyExists($listenerAttributes, 'options'); diff --git a/src/Suite/SuiteFactoryInterface.php b/src/Suite/SuiteFactoryInterface.php index 75a9e37..9c574e8 100644 --- a/src/Suite/SuiteFactoryInterface.php +++ b/src/Suite/SuiteFactoryInterface.php @@ -15,5 +15,6 @@ interface SuiteFactoryInterface { + /** @param array> $configuration */ public function createSuite(string $name, array $configuration): SuiteInterface; } diff --git a/src/Suite/SuiteInterface.php b/src/Suite/SuiteInterface.php index 8dfcd45..6e02ae6 100644 --- a/src/Suite/SuiteInterface.php +++ b/src/Suite/SuiteInterface.php @@ -21,14 +21,14 @@ interface SuiteInterface public function getName(): string; /** - * @return iterable Fixtures as keys, options as values + * @return iterable> Fixtures as keys, options as values */ public function getFixtures(): iterable; /** * @see \Sylius\Bundle\FixturesBundle\Listener\ListenerInterface * - * @return iterable Listeners as keys, options as values + * @return iterable> Listeners as keys, options as values */ public function getListeners(): iterable; } diff --git a/tests/DependencyInjection/SyliusFixturesExtensionTest.php b/tests/DependencyInjection/SyliusFixturesExtensionTest.php index b7c7731..6e36c52 100644 --- a/tests/DependencyInjection/SyliusFixturesExtensionTest.php +++ b/tests/DependencyInjection/SyliusFixturesExtensionTest.php @@ -58,14 +58,14 @@ public function it_autoconfigures_fixtures_and_listeners(): void $this->container->setDefinition( 'acme.fixture_autoconfigured', (new Definition()) - ->setClass($this->getMockClass(FixtureInterface::class)) + ->setClass($this->createMock(FixtureInterface::class)::class) ->setAutoconfigured(true), ); $this->container->setDefinition( 'acme.listener_autoconfigured', (new Definition()) - ->setClass($this->getMockClass(ListenerInterface::class)) + ->setClass($this->createMock(ListenerInterface::class)::class) ->setAutoconfigured(true), ); diff --git a/tests/Listener/MongoDBPurgerListenerTest.php b/tests/Listener/MongoDBPurgerListenerTest.php index 11330cf..607f62e 100644 --- a/tests/Listener/MongoDBPurgerListenerTest.php +++ b/tests/Listener/MongoDBPurgerListenerTest.php @@ -13,7 +13,7 @@ namespace Sylius\Bundle\FixturesBundle\Tests\Listener; -use Doctrine\Common\Persistence\ManagerRegistry; +use Doctrine\Persistence\ManagerRegistry; use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait; use PHPUnit\Framework\TestCase; use Sylius\Bundle\FixturesBundle\Listener\MongoDBPurgerListener; diff --git a/tests/Listener/PHPCRPurgerListenerTest.php b/tests/Listener/PHPCRPurgerListenerTest.php index 700cad7..fafc167 100644 --- a/tests/Listener/PHPCRPurgerListenerTest.php +++ b/tests/Listener/PHPCRPurgerListenerTest.php @@ -13,7 +13,7 @@ namespace Sylius\Bundle\FixturesBundle\Tests\Listener; -use Doctrine\Common\Persistence\ManagerRegistry; +use Doctrine\Persistence\ManagerRegistry; use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait; use PHPUnit\Framework\TestCase; use Sylius\Bundle\FixturesBundle\Listener\PHPCRPurgerListener; @@ -41,6 +41,9 @@ public function managers_are_optional(): void protected function getConfiguration(): ConfigurationInterface { - return new PHPCRPurgerListener($this->getMockBuilder(ManagerRegistry::class)->getMock()); + /** @var ManagerRegistry $registry */ + $registry = $this->createMock(ManagerRegistry::class); + + return new PHPCRPurgerListener($registry); } } diff --git a/tests/Loader/FixtureListCommandTest.php b/tests/Loader/FixtureListCommandTest.php index a9dcf5b..03a9370 100644 --- a/tests/Loader/FixtureListCommandTest.php +++ b/tests/Loader/FixtureListCommandTest.php @@ -76,6 +76,11 @@ public function it_lists_the_available_fixtures(): void ); } + /** + * @param array> $options + * + * @return array>}> + */ private function createFixture(string $name, array $options = []): array { return [ diff --git a/tests/Loader/FixtureLoaderTest.php b/tests/Loader/FixtureLoaderTest.php index ba36043..b58e513 100644 --- a/tests/Loader/FixtureLoaderTest.php +++ b/tests/Loader/FixtureLoaderTest.php @@ -32,8 +32,7 @@ final class FixtureLoaderTest extends KernelTestCase private EntityManagerInterface $em; - /** @var MockObject|LoggerInterface */ - private $logger; + private MockObject|LoggerInterface $logger; protected static $container; @@ -169,6 +168,11 @@ public function it_fails_if_no_default_suite_exist(): void $this->commandTester->execute([], ['interactive' => false]); } + /** + * @param array> $options + * + * @return array>}> + */ private function createConfiguration(string $name, array $options = []): array { return [ diff --git a/tests/Loader/SampleFixture.php b/tests/Loader/SampleFixture.php index e7890f4..4fd414b 100644 --- a/tests/Loader/SampleFixture.php +++ b/tests/Loader/SampleFixture.php @@ -25,13 +25,16 @@ public function __construct(EntityManagerInterface $entityManager) $this->entityManager = $entityManager; } + /** @param array> $options */ public function load(array $options): void { - $this->entityManager + $statement = $this->entityManager ->getConnection() - ->prepare('INSERT INTO testTable VALUES (?);') - ->execute(['test']) + ->prepare('INSERT INTO testTable VALUES (:test);') ; + + $statement->bindValue('test', 'test'); + $statement->executeStatement(); } public function getName(): string From c35304d6346b17f500f1dbec88946b58d213fc8a Mon Sep 17 00:00:00 2001 From: Jan Goralski Date: Tue, 23 Apr 2024 13:57:14 +0200 Subject: [PATCH 4/6] [Maintenance] Use promoted properties --- src/Command/FixturesListCommand.php | 13 ++++--------- src/Command/FixturesLoadCommand.php | 17 +++++------------ src/Listener/FixtureEvent.php | 17 +++++------------ src/Listener/LoggerListener.php | 5 +---- src/Listener/MongoDBPurgerListener.php | 5 +---- src/Listener/ORMPurgerListener.php | 5 +---- src/Listener/PHPCRPurgerListener.php | 5 +---- src/Listener/SuiteEvent.php | 5 +---- src/Listener/SuiteLoaderListener.php | 12 ++++-------- src/Loader/HookableFixtureLoader.php | 5 +---- src/Loader/HookableSuiteLoader.php | 5 +---- src/Loader/SuiteLoader.php | 5 +---- src/Suite/LazySuiteRegistry.php | 5 +---- src/Suite/Suite.php | 6 +----- src/Suite/SuiteFactory.php | 15 +++------------ 15 files changed, 31 insertions(+), 94 deletions(-) diff --git a/src/Command/FixturesListCommand.php b/src/Command/FixturesListCommand.php index 785a964..35b9ae2 100644 --- a/src/Command/FixturesListCommand.php +++ b/src/Command/FixturesListCommand.php @@ -21,16 +21,11 @@ final class FixturesListCommand extends Command { - private SuiteRegistryInterface $suiteRegistry; - - private FixtureRegistryInterface $fixtureRegistry; - - public function __construct(SuiteRegistryInterface $suiteRegistry, FixtureRegistryInterface $fixtureRegistry) - { + public function __construct( + private SuiteRegistryInterface $suiteRegistry, + private FixtureRegistryInterface $fixtureRegistry, + ) { parent::__construct(null); - - $this->suiteRegistry = $suiteRegistry; - $this->fixtureRegistry = $fixtureRegistry; } protected function configure(): void diff --git a/src/Command/FixturesLoadCommand.php b/src/Command/FixturesLoadCommand.php index b7ef6d9..bbafc1a 100644 --- a/src/Command/FixturesLoadCommand.php +++ b/src/Command/FixturesLoadCommand.php @@ -24,19 +24,12 @@ final class FixturesLoadCommand extends Command { - private SuiteRegistryInterface $suiteRegistry; - - private SuiteLoaderInterface $suiteLoader; - - private string $environment; - - public function __construct(SuiteRegistryInterface $suiteRegistry, SuiteLoaderInterface $suiteLoader, string $environment) - { + public function __construct( + private SuiteRegistryInterface $suiteRegistry, + private SuiteLoaderInterface $suiteLoader, + private string $environment, + ) { parent::__construct(null); - - $this->suiteRegistry = $suiteRegistry; - $this->suiteLoader = $suiteLoader; - $this->environment = $environment; } protected function configure(): void diff --git a/src/Listener/FixtureEvent.php b/src/Listener/FixtureEvent.php index b6e6df2..e276641 100644 --- a/src/Listener/FixtureEvent.php +++ b/src/Listener/FixtureEvent.php @@ -18,19 +18,12 @@ final class FixtureEvent { - private SuiteInterface $suite; - - private FixtureInterface $fixture; - - /** @var array */ - private array $fixtureOptions; - /** @param array $fixtureOptions */ - public function __construct(SuiteInterface $suite, FixtureInterface $fixture, array $fixtureOptions) - { - $this->suite = $suite; - $this->fixture = $fixture; - $this->fixtureOptions = $fixtureOptions; + public function __construct( + private SuiteInterface $suite, + private FixtureInterface $fixture, + private array $fixtureOptions, + ) { } public function suite(): SuiteInterface diff --git a/src/Listener/LoggerListener.php b/src/Listener/LoggerListener.php index b82f1b8..4a823ac 100644 --- a/src/Listener/LoggerListener.php +++ b/src/Listener/LoggerListener.php @@ -17,11 +17,8 @@ final class LoggerListener extends AbstractListener implements BeforeSuiteListenerInterface, BeforeFixtureListenerInterface { - private LoggerInterface $logger; - - public function __construct(LoggerInterface $logger) + public function __construct(private LoggerInterface $logger) { - $this->logger = $logger; } /** @param array $options */ diff --git a/src/Listener/MongoDBPurgerListener.php b/src/Listener/MongoDBPurgerListener.php index fd690b6..c4a19ee 100644 --- a/src/Listener/MongoDBPurgerListener.php +++ b/src/Listener/MongoDBPurgerListener.php @@ -20,11 +20,8 @@ final class MongoDBPurgerListener extends AbstractListener implements BeforeSuiteListenerInterface { - private ManagerRegistry $managerRegistry; - - public function __construct(ManagerRegistry $managerRegistry) + public function __construct(private ManagerRegistry $managerRegistry) { - $this->managerRegistry = $managerRegistry; } /** @param array{managers: string[]} $options */ diff --git a/src/Listener/ORMPurgerListener.php b/src/Listener/ORMPurgerListener.php index e0d027e..81a5961 100644 --- a/src/Listener/ORMPurgerListener.php +++ b/src/Listener/ORMPurgerListener.php @@ -20,17 +20,14 @@ final class ORMPurgerListener extends AbstractListener implements BeforeSuiteListenerInterface { - private ManagerRegistry $managerRegistry; - /** @var array */ private static array $purgeModes = [ 'delete' => ORMPurger::PURGE_MODE_DELETE, 'truncate' => ORMPurger::PURGE_MODE_TRUNCATE, ]; - public function __construct(ManagerRegistry $managerRegistry) + public function __construct(private ManagerRegistry $managerRegistry) { - $this->managerRegistry = $managerRegistry; } /** @param array{managers: string[], exclude: array, mode: string} $options */ diff --git a/src/Listener/PHPCRPurgerListener.php b/src/Listener/PHPCRPurgerListener.php index 7333e37..b90ce0a 100644 --- a/src/Listener/PHPCRPurgerListener.php +++ b/src/Listener/PHPCRPurgerListener.php @@ -20,11 +20,8 @@ final class PHPCRPurgerListener extends AbstractListener implements BeforeSuiteListenerInterface { - private ManagerRegistry $managerRegistry; - - public function __construct(ManagerRegistry $managerRegistry) + public function __construct(private ManagerRegistry $managerRegistry) { - $this->managerRegistry = $managerRegistry; } /** @param array{managers: string[]} $options */ diff --git a/src/Listener/SuiteEvent.php b/src/Listener/SuiteEvent.php index ed6e110..e140029 100644 --- a/src/Listener/SuiteEvent.php +++ b/src/Listener/SuiteEvent.php @@ -17,11 +17,8 @@ final class SuiteEvent { - private SuiteInterface $suite; - - public function __construct(SuiteInterface $suite) + public function __construct(private SuiteInterface $suite) { - $this->suite = $suite; } public function suite(): SuiteInterface diff --git a/src/Listener/SuiteLoaderListener.php b/src/Listener/SuiteLoaderListener.php index af3e5ad..beaabf0 100644 --- a/src/Listener/SuiteLoaderListener.php +++ b/src/Listener/SuiteLoaderListener.php @@ -19,14 +19,10 @@ final class SuiteLoaderListener extends AbstractListener implements BeforeSuiteListenerInterface { - private SuiteRegistryInterface $suiteRegistry; - - private SuiteLoaderInterface $suiteLoader; - - public function __construct(SuiteRegistryInterface $suiteRegistry, SuiteLoaderInterface $suiteLoader) - { - $this->suiteRegistry = $suiteRegistry; - $this->suiteLoader = $suiteLoader; + public function __construct( + private SuiteRegistryInterface $suiteRegistry, + private SuiteLoaderInterface $suiteLoader, + ) { } public function getName(): string diff --git a/src/Loader/HookableFixtureLoader.php b/src/Loader/HookableFixtureLoader.php index e39df9a..6b7bc17 100644 --- a/src/Loader/HookableFixtureLoader.php +++ b/src/Loader/HookableFixtureLoader.php @@ -21,11 +21,8 @@ final class HookableFixtureLoader implements FixtureLoaderInterface { - private FixtureLoaderInterface $decoratedFixtureLoader; - - public function __construct(FixtureLoaderInterface $decoratedFixtureLoader) + public function __construct(private FixtureLoaderInterface $decoratedFixtureLoader) { - $this->decoratedFixtureLoader = $decoratedFixtureLoader; } public function load(SuiteInterface $suite, FixtureInterface $fixture, array $options): void diff --git a/src/Loader/HookableSuiteLoader.php b/src/Loader/HookableSuiteLoader.php index 0958baa..fc19b80 100644 --- a/src/Loader/HookableSuiteLoader.php +++ b/src/Loader/HookableSuiteLoader.php @@ -20,11 +20,8 @@ final class HookableSuiteLoader implements SuiteLoaderInterface { - private SuiteLoaderInterface $decoratedSuiteLoader; - - public function __construct(SuiteLoaderInterface $decoratedSuiteLoader) + public function __construct(private SuiteLoaderInterface $decoratedSuiteLoader) { - $this->decoratedSuiteLoader = $decoratedSuiteLoader; } public function load(SuiteInterface $suite): void diff --git a/src/Loader/SuiteLoader.php b/src/Loader/SuiteLoader.php index f3426ac..f9147e4 100644 --- a/src/Loader/SuiteLoader.php +++ b/src/Loader/SuiteLoader.php @@ -18,11 +18,8 @@ final class SuiteLoader implements SuiteLoaderInterface { - private FixtureLoaderInterface $fixtureLoader; - - public function __construct(FixtureLoaderInterface $fixtureLoader) + public function __construct(private FixtureLoaderInterface $fixtureLoader) { - $this->fixtureLoader = $fixtureLoader; } public function load(SuiteInterface $suite): void diff --git a/src/Suite/LazySuiteRegistry.php b/src/Suite/LazySuiteRegistry.php index dece4c3..17f4def 100644 --- a/src/Suite/LazySuiteRegistry.php +++ b/src/Suite/LazySuiteRegistry.php @@ -15,17 +15,14 @@ final class LazySuiteRegistry implements SuiteRegistryInterface { - private SuiteFactoryInterface $suiteFactory; - /** @var array> */ private array $suiteDefinitions = []; /** @var array> */ private array $suites = []; - public function __construct(SuiteFactoryInterface $suiteFactory) + public function __construct(private SuiteFactoryInterface $suiteFactory) { - $this->suiteFactory = $suiteFactory; } /** @param array $configuration */ diff --git a/src/Suite/Suite.php b/src/Suite/Suite.php index 3ca381e..2e960a4 100644 --- a/src/Suite/Suite.php +++ b/src/Suite/Suite.php @@ -18,15 +18,12 @@ final class Suite implements SuiteInterface { - private string $name; - private PriorityQueue $fixtures; private PriorityQueue $listeners; - public function __construct(string $name) + public function __construct(private string $name) { - $this->name = $name; $this->fixtures = new PriorityQueue(); $this->listeners = new PriorityQueue(); } @@ -48,7 +45,6 @@ public function getName(): string return $this->name; } - /** @returns */ public function getFixtures(): iterable { foreach ($this->fixtures as $fixture) { diff --git a/src/Suite/SuiteFactory.php b/src/Suite/SuiteFactory.php index 765cb5d..41d299f 100644 --- a/src/Suite/SuiteFactory.php +++ b/src/Suite/SuiteFactory.php @@ -20,20 +20,11 @@ final class SuiteFactory implements SuiteFactoryInterface { - private FixtureRegistryInterface $fixtureRegistry; - - private ListenerRegistryInterface $listenerRegistry; - - private Processor $optionsProcessor; - public function __construct( - FixtureRegistryInterface $fixtureRegistry, - ListenerRegistryInterface $listenerRegistry, - Processor $optionsProcessor, + private FixtureRegistryInterface $fixtureRegistry, + private ListenerRegistryInterface $listenerRegistry, + private Processor $optionsProcessor, ) { - $this->fixtureRegistry = $fixtureRegistry; - $this->listenerRegistry = $listenerRegistry; - $this->optionsProcessor = $optionsProcessor; } public function createSuite(string $name, array $configuration): SuiteInterface From d6319cd71d9f9b6838cb8bf41411ade30f702cff Mon Sep 17 00:00:00 2001 From: Jan Goralski Date: Tue, 23 Apr 2024 14:01:30 +0200 Subject: [PATCH 5/6] [Maintenance] Update copyright and licence --- LICENSE | 2 +- ecs.php | 2 +- spec/Fixture/FixtureNotFoundExceptionSpec.php | 2 +- spec/Fixture/FixtureRegistrySpec.php | 2 +- spec/Listener/ListenerNotFoundExceptionSpec.php | 2 +- spec/Listener/ListenerRegistrySpec.php | 2 +- spec/Listener/LoggerListenerSpec.php | 2 +- spec/Listener/SuiteLoaderListenerSpec.php | 2 +- spec/Loader/FixtureLoaderSpec.php | 2 +- spec/Loader/HookableFixtureLoaderSpec.php | 2 +- spec/Loader/HookableSuiteLoaderSpec.php | 2 +- spec/Loader/SuiteLoaderSpec.php | 2 +- spec/Suite/LazySuiteRegistrySpec.php | 2 +- spec/Suite/PriorityQueueSpec.php | 2 +- spec/Suite/SuiteFactorySpec.php | 2 +- spec/Suite/SuiteNotFoundExceptionSpec.php | 2 +- spec/Suite/SuiteSpec.php | 2 +- src/Command/FixturesListCommand.php | 2 +- src/Command/FixturesLoadCommand.php | 2 +- src/DependencyInjection/Compiler/FixtureRegistryPass.php | 2 +- src/DependencyInjection/Compiler/ListenerRegistryPass.php | 2 +- src/DependencyInjection/Configuration.php | 2 +- src/DependencyInjection/SyliusFixturesExtension.php | 2 +- src/Fixture/AbstractFixture.php | 2 +- src/Fixture/FixtureInterface.php | 2 +- src/Fixture/FixtureNotFoundException.php | 2 +- src/Fixture/FixtureRegistry.php | 2 +- src/Fixture/FixtureRegistryInterface.php | 2 +- src/Listener/AbstractListener.php | 2 +- src/Listener/AfterFixtureListenerInterface.php | 2 +- src/Listener/AfterSuiteListenerInterface.php | 2 +- src/Listener/BeforeFixtureListenerInterface.php | 2 +- src/Listener/BeforeSuiteListenerInterface.php | 2 +- src/Listener/FixtureEvent.php | 2 +- src/Listener/ListenerInterface.php | 2 +- src/Listener/ListenerNotFoundException.php | 2 +- src/Listener/ListenerRegistry.php | 2 +- src/Listener/ListenerRegistryInterface.php | 2 +- src/Listener/LoggerListener.php | 2 +- src/Listener/MongoDBPurgerListener.php | 2 +- src/Listener/ORMPurgerListener.php | 2 +- src/Listener/PHPCRPurgerListener.php | 2 +- src/Listener/SuiteEvent.php | 2 +- src/Listener/SuiteLoaderListener.php | 2 +- src/Loader/FixtureLoader.php | 2 +- src/Loader/FixtureLoaderInterface.php | 2 +- src/Loader/HookableFixtureLoader.php | 2 +- src/Loader/HookableSuiteLoader.php | 2 +- src/Loader/SuiteLoader.php | 2 +- src/Loader/SuiteLoaderInterface.php | 2 +- src/Resources/config/services.xml | 2 +- src/Resources/config/services/fixture.xml | 2 +- .../config/services/integrations/doctrine/mongodb-odm.xml | 2 +- src/Resources/config/services/integrations/doctrine/orm.xml | 2 +- .../config/services/integrations/doctrine/phpcr-odm.xml | 2 +- src/Resources/config/services/listener.xml | 4 ++-- src/Resources/config/services/loader.xml | 2 +- src/Resources/config/services/logger.xml | 2 +- src/Resources/config/services/suite.xml | 2 +- src/Suite/LazySuiteRegistry.php | 2 +- src/Suite/PriorityQueue.php | 2 +- src/Suite/Suite.php | 2 +- src/Suite/SuiteFactory.php | 2 +- src/Suite/SuiteFactoryInterface.php | 2 +- src/Suite/SuiteInterface.php | 2 +- src/Suite/SuiteNotFoundException.php | 2 +- src/Suite/SuiteRegistryInterface.php | 2 +- src/SyliusFixturesBundle.php | 2 +- tests/Application/Kernel.php | 2 +- .../DependencyInjection/Compiler/FixtureRegistryPassTest.php | 2 +- .../DependencyInjection/Compiler/ListenerRegistryPassTest.php | 2 +- tests/DependencyInjection/ConfigurationTest.php | 2 +- tests/DependencyInjection/SyliusFixturesExtensionTest.php | 2 +- tests/Listener/MongoDBPurgerListenerTest.php | 2 +- tests/Listener/ORMPurgerListenerTest.php | 2 +- tests/Listener/PHPCRPurgerListenerTest.php | 2 +- tests/Listener/SuiteLoaderListenerTest.php | 2 +- tests/Loader/FixtureListCommandTest.php | 2 +- tests/Loader/FixtureLoaderTest.php | 2 +- tests/Loader/SampleFixture.php | 2 +- tests/Smoke/SyliusFixturesBundleTest.php | 2 +- 81 files changed, 82 insertions(+), 82 deletions(-) diff --git a/LICENSE b/LICENSE index b674a68..3cee851 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2011-2019 Paweł Jędrzejewski +Copyright (c) 2011-present Sylius Sp. z o.o. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/ecs.php b/ecs.php index 4b9bd2e..61fb412 100644 --- a/ecs.php +++ b/ecs.php @@ -25,7 +25,7 @@ 'header' => << - + diff --git a/src/Resources/config/services/loader.xml b/src/Resources/config/services/loader.xml index baf2041..1cfbdd6 100644 --- a/src/Resources/config/services/loader.xml +++ b/src/Resources/config/services/loader.xml @@ -4,7 +4,7 @@ This file is part of the Sylius package. - (c) Paweł Jędrzejewski + (c) Sylius Sp. z o.o. For the full copyright and license information, please view the LICENSE file that was distributed with this source code. diff --git a/src/Resources/config/services/logger.xml b/src/Resources/config/services/logger.xml index c798e19..ae5510f 100644 --- a/src/Resources/config/services/logger.xml +++ b/src/Resources/config/services/logger.xml @@ -4,7 +4,7 @@ This file is part of the Sylius package. - (c) Paweł Jędrzejewski + (c) Sylius Sp. z o.o. For the full copyright and license information, please view the LICENSE file that was distributed with this source code. diff --git a/src/Resources/config/services/suite.xml b/src/Resources/config/services/suite.xml index a29d02b..f1c716d 100644 --- a/src/Resources/config/services/suite.xml +++ b/src/Resources/config/services/suite.xml @@ -4,7 +4,7 @@ This file is part of the Sylius package. - (c) Paweł Jędrzejewski + (c) Sylius Sp. z o.o. For the full copyright and license information, please view the LICENSE file that was distributed with this source code. diff --git a/src/Suite/LazySuiteRegistry.php b/src/Suite/LazySuiteRegistry.php index 17f4def..75cf25a 100644 --- a/src/Suite/LazySuiteRegistry.php +++ b/src/Suite/LazySuiteRegistry.php @@ -3,7 +3,7 @@ /* * This file is part of the Sylius package. * - * (c) Paweł Jędrzejewski + * (c) Sylius Sp. z o.o. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Suite/PriorityQueue.php b/src/Suite/PriorityQueue.php index afe8186..c74764a 100644 --- a/src/Suite/PriorityQueue.php +++ b/src/Suite/PriorityQueue.php @@ -3,7 +3,7 @@ /* * This file is part of the Sylius package. * - * (c) Paweł Jędrzejewski + * (c) Sylius Sp. z o.o. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Suite/Suite.php b/src/Suite/Suite.php index 2e960a4..051d7e3 100644 --- a/src/Suite/Suite.php +++ b/src/Suite/Suite.php @@ -3,7 +3,7 @@ /* * This file is part of the Sylius package. * - * (c) Paweł Jędrzejewski + * (c) Sylius Sp. z o.o. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Suite/SuiteFactory.php b/src/Suite/SuiteFactory.php index 41d299f..a833bb0 100644 --- a/src/Suite/SuiteFactory.php +++ b/src/Suite/SuiteFactory.php @@ -3,7 +3,7 @@ /* * This file is part of the Sylius package. * - * (c) Paweł Jędrzejewski + * (c) Sylius Sp. z o.o. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Suite/SuiteFactoryInterface.php b/src/Suite/SuiteFactoryInterface.php index 9c574e8..d7ca177 100644 --- a/src/Suite/SuiteFactoryInterface.php +++ b/src/Suite/SuiteFactoryInterface.php @@ -3,7 +3,7 @@ /* * This file is part of the Sylius package. * - * (c) Paweł Jędrzejewski + * (c) Sylius Sp. z o.o. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Suite/SuiteInterface.php b/src/Suite/SuiteInterface.php index 6e02ae6..c998f20 100644 --- a/src/Suite/SuiteInterface.php +++ b/src/Suite/SuiteInterface.php @@ -3,7 +3,7 @@ /* * This file is part of the Sylius package. * - * (c) Paweł Jędrzejewski + * (c) Sylius Sp. z o.o. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Suite/SuiteNotFoundException.php b/src/Suite/SuiteNotFoundException.php index 3d0ee1b..4f3addc 100644 --- a/src/Suite/SuiteNotFoundException.php +++ b/src/Suite/SuiteNotFoundException.php @@ -3,7 +3,7 @@ /* * This file is part of the Sylius package. * - * (c) Paweł Jędrzejewski + * (c) Sylius Sp. z o.o. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Suite/SuiteRegistryInterface.php b/src/Suite/SuiteRegistryInterface.php index 5f4031d..153a20f 100644 --- a/src/Suite/SuiteRegistryInterface.php +++ b/src/Suite/SuiteRegistryInterface.php @@ -3,7 +3,7 @@ /* * This file is part of the Sylius package. * - * (c) Paweł Jędrzejewski + * (c) Sylius Sp. z o.o. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/SyliusFixturesBundle.php b/src/SyliusFixturesBundle.php index 0630c00..bc88f0b 100644 --- a/src/SyliusFixturesBundle.php +++ b/src/SyliusFixturesBundle.php @@ -3,7 +3,7 @@ /* * This file is part of the Sylius package. * - * (c) Paweł Jędrzejewski + * (c) Sylius Sp. z o.o. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Application/Kernel.php b/tests/Application/Kernel.php index 52e993e..186ef9b 100644 --- a/tests/Application/Kernel.php +++ b/tests/Application/Kernel.php @@ -3,7 +3,7 @@ /* * This file is part of the Sylius package. * - * (c) Paweł Jędrzejewski + * (c) Sylius Sp. z o.o. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/DependencyInjection/Compiler/FixtureRegistryPassTest.php b/tests/DependencyInjection/Compiler/FixtureRegistryPassTest.php index 2aa0750..3bf278e 100644 --- a/tests/DependencyInjection/Compiler/FixtureRegistryPassTest.php +++ b/tests/DependencyInjection/Compiler/FixtureRegistryPassTest.php @@ -3,7 +3,7 @@ /* * This file is part of the Sylius package. * - * (c) Paweł Jędrzejewski + * (c) Sylius Sp. z o.o. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/DependencyInjection/Compiler/ListenerRegistryPassTest.php b/tests/DependencyInjection/Compiler/ListenerRegistryPassTest.php index 5e2f472..c72f91e 100644 --- a/tests/DependencyInjection/Compiler/ListenerRegistryPassTest.php +++ b/tests/DependencyInjection/Compiler/ListenerRegistryPassTest.php @@ -3,7 +3,7 @@ /* * This file is part of the Sylius package. * - * (c) Paweł Jędrzejewski + * (c) Sylius Sp. z o.o. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/DependencyInjection/ConfigurationTest.php b/tests/DependencyInjection/ConfigurationTest.php index 9d5a6ec..88b838b 100644 --- a/tests/DependencyInjection/ConfigurationTest.php +++ b/tests/DependencyInjection/ConfigurationTest.php @@ -3,7 +3,7 @@ /* * This file is part of the Sylius package. * - * (c) Paweł Jędrzejewski + * (c) Sylius Sp. z o.o. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/DependencyInjection/SyliusFixturesExtensionTest.php b/tests/DependencyInjection/SyliusFixturesExtensionTest.php index 6e36c52..91f5ed2 100644 --- a/tests/DependencyInjection/SyliusFixturesExtensionTest.php +++ b/tests/DependencyInjection/SyliusFixturesExtensionTest.php @@ -3,7 +3,7 @@ /* * This file is part of the Sylius package. * - * (c) Paweł Jędrzejewski + * (c) Sylius Sp. z o.o. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Listener/MongoDBPurgerListenerTest.php b/tests/Listener/MongoDBPurgerListenerTest.php index 607f62e..94f2981 100644 --- a/tests/Listener/MongoDBPurgerListenerTest.php +++ b/tests/Listener/MongoDBPurgerListenerTest.php @@ -3,7 +3,7 @@ /* * This file is part of the Sylius package. * - * (c) Paweł Jędrzejewski + * (c) Sylius Sp. z o.o. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Listener/ORMPurgerListenerTest.php b/tests/Listener/ORMPurgerListenerTest.php index 2aaa9bd..749e5f8 100644 --- a/tests/Listener/ORMPurgerListenerTest.php +++ b/tests/Listener/ORMPurgerListenerTest.php @@ -3,7 +3,7 @@ /* * This file is part of the Sylius package. * - * (c) Paweł Jędrzejewski + * (c) Sylius Sp. z o.o. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Listener/PHPCRPurgerListenerTest.php b/tests/Listener/PHPCRPurgerListenerTest.php index fafc167..b64d38c 100644 --- a/tests/Listener/PHPCRPurgerListenerTest.php +++ b/tests/Listener/PHPCRPurgerListenerTest.php @@ -3,7 +3,7 @@ /* * This file is part of the Sylius package. * - * (c) Paweł Jędrzejewski + * (c) Sylius Sp. z o.o. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Listener/SuiteLoaderListenerTest.php b/tests/Listener/SuiteLoaderListenerTest.php index 36a4d77..cfbc3ce 100644 --- a/tests/Listener/SuiteLoaderListenerTest.php +++ b/tests/Listener/SuiteLoaderListenerTest.php @@ -3,7 +3,7 @@ /* * This file is part of the Sylius package. * - * (c) Paweł Jędrzejewski + * (c) Sylius Sp. z o.o. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Loader/FixtureListCommandTest.php b/tests/Loader/FixtureListCommandTest.php index 03a9370..79f0708 100644 --- a/tests/Loader/FixtureListCommandTest.php +++ b/tests/Loader/FixtureListCommandTest.php @@ -3,7 +3,7 @@ /* * This file is part of the Sylius package. * - * (c) Paweł Jędrzejewski + * (c) Sylius Sp. z o.o. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Loader/FixtureLoaderTest.php b/tests/Loader/FixtureLoaderTest.php index b58e513..06bafcb 100644 --- a/tests/Loader/FixtureLoaderTest.php +++ b/tests/Loader/FixtureLoaderTest.php @@ -3,7 +3,7 @@ /* * This file is part of the Sylius package. * - * (c) Paweł Jędrzejewski + * (c) Sylius Sp. z o.o. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Loader/SampleFixture.php b/tests/Loader/SampleFixture.php index 4fd414b..4bb6f4f 100644 --- a/tests/Loader/SampleFixture.php +++ b/tests/Loader/SampleFixture.php @@ -3,7 +3,7 @@ /* * This file is part of the Sylius package. * - * (c) Paweł Jędrzejewski + * (c) Sylius Sp. z o.o. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Smoke/SyliusFixturesBundleTest.php b/tests/Smoke/SyliusFixturesBundleTest.php index 25a9048..a2abb96 100644 --- a/tests/Smoke/SyliusFixturesBundleTest.php +++ b/tests/Smoke/SyliusFixturesBundleTest.php @@ -3,7 +3,7 @@ /* * This file is part of the Sylius package. * - * (c) Paweł Jędrzejewski + * (c) Sylius Sp. z o.o. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. From 0ba9d063b3ce49e9ed176be98d25a2751a81c1cc Mon Sep 17 00:00:00 2001 From: Jan Goralski Date: Tue, 30 Jul 2024 10:15:10 +0200 Subject: [PATCH 6/6] [Maintenance] Drop support for PHP 8.0 --- .github/workflows/build.yml | 8 +------- composer.json | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ab834d2..8b8ba05 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,16 +17,10 @@ jobs: strategy: fail-fast: false matrix: - php: ["8.0", "8.1", "8.2"] + php: ["8.1", "8.2", "8.3"] symfony: ["^5.4", "^6.4", "^7.0"] dbal: ["^2.0", "^3.0"] exclude: - - - php: "8.0" - symfony: "^6.4" - - - php: "8.0" - symfony: "^7.0" - php: "8.1" symfony: "^7.0" diff --git a/composer.json b/composer.json index 85ff0b0..8219e0d 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ } ], "require": { - "php": "^8.0", + "php": "^8.1", "doctrine/data-fixtures": "^1.2", "monolog/monolog": "^1.25 || ^2.1 || ^3", "symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0",