diff --git a/.github/workflows/test-application.yaml b/.github/workflows/test-application.yaml index 3540848..803fff0 100644 --- a/.github/workflows/test-application.yaml +++ b/.github/workflows/test-application.yaml @@ -11,7 +11,7 @@ on: jobs: test: name: "PHP ${{ matrix.php-version }}, Symfony ${{ matrix.symfony-version }}" - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-latest" env: SYMFONY_REQUIRE: ${{matrix.symfony-require}} diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e692b9..28b15f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ Changelog Version 3 ========= +3.0.3 +----- + +* PHPCRExecutor no longer extends Doctrine\Common\DataFixtures\Executor\PHPCRExecutor because that class is final since `doctrine/data-fixtures` version 2. + 3.0.2 ----- diff --git a/composer.json b/composer.json index 9a08df6..4dbd919 100644 --- a/composer.json +++ b/composer.json @@ -40,16 +40,17 @@ }, "require-dev": { "ext-libxml": "*", + "doctrine/data-fixtures": "^2.0", "doctrine/doctrine-bundle": "^2.0.3", "doctrine/phpcr-odm": "^2.0", "doctrine/orm": "^2.0 || ^3.0", "jackalope/jackalope-doctrine-dbal": "^2.0", "matthiasnoback/symfony-dependency-injection-test": "^4.3.1 || ^5.0", "phpcr/phpcr-shell": "^1.6", - "phpstan/phpstan": "^1.10", - "phpstan/phpstan-doctrine": "^1.3", - "phpstan/phpstan-phpunit": "^1.3", - "phpstan/phpstan-symfony": "^1.3", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-doctrine": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-symfony": "^2.0", "phpunit/phpunit": "^9.5", "symfony/asset": "^5.4 || ^6.0 || ^7.0", "symfony/browser-kit": "^5.4 || ^6.0 || ^7.0", diff --git a/src/Command/MigratorMigrateCommand.php b/src/Command/MigratorMigrateCommand.php index 03b5c18..e8dc7fd 100644 --- a/src/Command/MigratorMigrateCommand.php +++ b/src/Command/MigratorMigrateCommand.php @@ -16,7 +16,7 @@ class MigratorMigrateCommand extends BaseCommand private const NAME = 'doctrine:phpcr:migrator:migrate'; public function __construct( - private ContainerInterface $container + private ContainerInterface $container, ) { parent::__construct(self::NAME); } diff --git a/src/Command/NodeDumpCommand.php b/src/Command/NodeDumpCommand.php index 631f76a..46ecb1a 100644 --- a/src/Command/NodeDumpCommand.php +++ b/src/Command/NodeDumpCommand.php @@ -20,7 +20,7 @@ class NodeDumpCommand extends BaseDumpCommand public function __construct( private PhpcrConsoleDumperHelper $consoleDumper, - private int $dumpMaxLineLength + private int $dumpMaxLineLength, ) { parent::__construct(self::NAME); } diff --git a/src/Command/RepositoryInitCommand.php b/src/Command/RepositoryInitCommand.php index 0152509..ada3968 100644 --- a/src/Command/RepositoryInitCommand.php +++ b/src/Command/RepositoryInitCommand.php @@ -19,7 +19,7 @@ class RepositoryInitCommand extends Command private const NAME = 'doctrine:phpcr:repository:init'; public function __construct( - private InitializerManager $initializerManager + private InitializerManager $initializerManager, ) { parent::__construct(self::NAME); } diff --git a/src/DataFixtures/PHPCRExecutor.php b/src/DataFixtures/PHPCRExecutor.php index d840082..d31a955 100644 --- a/src/DataFixtures/PHPCRExecutor.php +++ b/src/DataFixtures/PHPCRExecutor.php @@ -3,6 +3,7 @@ namespace Doctrine\Bundle\PHPCRBundle\DataFixtures; use Doctrine\Bundle\PHPCRBundle\Initializer\InitializerManager; +use Doctrine\Common\DataFixtures\Executor\AbstractExecutor; use Doctrine\Common\DataFixtures\Executor\PHPCRExecutor as BasePHPCRExecutor; use Doctrine\Common\DataFixtures\Purger\PHPCRPurger; use Doctrine\ODM\PHPCR\DocumentManagerInterface; @@ -12,14 +13,17 @@ * * @author Daniel Leech */ -final class PHPCRExecutor extends BasePHPCRExecutor +final class PHPCRExecutor extends AbstractExecutor { + private BasePHPCRExecutor $wrappedExecutor; + public function __construct( DocumentManagerInterface $dm, ?PHPCRPurger $purger = null, - private ?InitializerManager $initializerManager = null + private ?InitializerManager $initializerManager = null, ) { - parent::__construct($dm, $purger); + parent::__construct($dm); + $this->wrappedExecutor = new BasePHPCRExecutor($dm, $purger); } public function purge(): void @@ -31,4 +35,14 @@ public function purge(): void $this->initializerManager->initialize(); } } + + public function execute(array $fixtures, bool $append = false): void + { + $this->wrappedExecutor->execute($fixtures, $append); + } + + public function getObjectManager(): DocumentManagerInterface + { + return $this->wrappedExecutor->getObjectManager(); + } } diff --git a/src/EventListener/JackalopeDoctrineDbalSchemaListener.php b/src/EventListener/JackalopeDoctrineDbalSchemaListener.php index e5c40e7..3dac07d 100644 --- a/src/EventListener/JackalopeDoctrineDbalSchemaListener.php +++ b/src/EventListener/JackalopeDoctrineDbalSchemaListener.php @@ -18,7 +18,7 @@ class JackalopeDoctrineDbalSchemaListener { public function __construct( - private RepositorySchema $schema + private RepositorySchema $schema, ) { } diff --git a/src/ManagerRegistry.php b/src/ManagerRegistry.php index c9073dd..3ca89a3 100644 --- a/src/ManagerRegistry.php +++ b/src/ManagerRegistry.php @@ -22,7 +22,7 @@ public function __construct( array $entityManagers, string $defaultConnectionName, string $defaultEntityManagerName, - string $proxyInterfaceName + string $proxyInterfaceName, ) { $this->container = $container; diff --git a/src/OptionalCommand/ODM/LoadFixtureCommand.php b/src/OptionalCommand/ODM/LoadFixtureCommand.php index cdda73f..892266e 100644 --- a/src/OptionalCommand/ODM/LoadFixtureCommand.php +++ b/src/OptionalCommand/ODM/LoadFixtureCommand.php @@ -28,7 +28,7 @@ class LoadFixtureCommand extends BaseCommand private const NAME = 'doctrine:phpcr:fixtures:load'; public function __construct( - private InitializerManager $initializerManager + private InitializerManager $initializerManager, ) { parent::__construct(self::NAME); } diff --git a/tests/Fixtures/App/Document/ReferrerDocument.php b/tests/Fixtures/App/Document/ReferrerDocument.php index 83cfc27..71fb93f 100644 --- a/tests/Fixtures/App/Document/ReferrerDocument.php +++ b/tests/Fixtures/App/Document/ReferrerDocument.php @@ -16,7 +16,7 @@ use Doctrine\ODM\PHPCR\Mapping\Attributes as PHPCR; #[PHPCR\Document] -class ReferrerDocument +class ReferrerDocument implements \Stringable { #[PHPCR\Id(strategy: 'assigned')] public string $id; diff --git a/tests/Fixtures/App/Document/TestDocument.php b/tests/Fixtures/App/Document/TestDocument.php index 292f7d8..95ec306 100644 --- a/tests/Fixtures/App/Document/TestDocument.php +++ b/tests/Fixtures/App/Document/TestDocument.php @@ -7,7 +7,7 @@ use Doctrine\ODM\PHPCR\Mapping\Attributes as PHPCR; #[PHPCR\Document(referenceable: true)] -class TestDocument +class TestDocument implements \Stringable { #[PHPCR\Id] public string $id;