Skip to content

Commit 29344d7

Browse files
authored
Merge pull request #411 from doctrine/cs-fixer
upgrade to phpstan 2 and apply latest php-cs-fixer fixes
2 parents 799c24d + 64f2025 commit 29344d7

File tree

12 files changed

+36
-16
lines changed

12 files changed

+36
-16
lines changed

.github/workflows/test-application.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
jobs:
1212
test:
1313
name: "PHP ${{ matrix.php-version }}, Symfony ${{ matrix.symfony-version }}"
14-
runs-on: "ubuntu-20.04"
14+
runs-on: "ubuntu-latest"
1515
env:
1616
SYMFONY_REQUIRE: ${{matrix.symfony-require}}
1717

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ Changelog
44
Version 3
55
=========
66

7+
3.0.3
8+
-----
9+
10+
* PHPCRExecutor no longer extends Doctrine\Common\DataFixtures\Executor\PHPCRExecutor because that class is final since `doctrine/data-fixtures` version 2.
11+
712
3.0.2
813
-----
914

composer.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,17 @@
4040
},
4141
"require-dev": {
4242
"ext-libxml": "*",
43+
"doctrine/data-fixtures": "^2.0",
4344
"doctrine/doctrine-bundle": "^2.0.3",
4445
"doctrine/phpcr-odm": "^2.0",
4546
"doctrine/orm": "^2.0 || ^3.0",
4647
"jackalope/jackalope-doctrine-dbal": "^2.0",
4748
"matthiasnoback/symfony-dependency-injection-test": "^4.3.1 || ^5.0",
4849
"phpcr/phpcr-shell": "^1.6",
49-
"phpstan/phpstan": "^1.10",
50-
"phpstan/phpstan-doctrine": "^1.3",
51-
"phpstan/phpstan-phpunit": "^1.3",
52-
"phpstan/phpstan-symfony": "^1.3",
50+
"phpstan/phpstan": "^2.0",
51+
"phpstan/phpstan-doctrine": "^2.0",
52+
"phpstan/phpstan-phpunit": "^2.0",
53+
"phpstan/phpstan-symfony": "^2.0",
5354
"phpunit/phpunit": "^9.5",
5455
"symfony/asset": "^5.4 || ^6.0 || ^7.0",
5556
"symfony/browser-kit": "^5.4 || ^6.0 || ^7.0",

src/Command/MigratorMigrateCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class MigratorMigrateCommand extends BaseCommand
1616
private const NAME = 'doctrine:phpcr:migrator:migrate';
1717

1818
public function __construct(
19-
private ContainerInterface $container
19+
private ContainerInterface $container,
2020
) {
2121
parent::__construct(self::NAME);
2222
}

src/Command/NodeDumpCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class NodeDumpCommand extends BaseDumpCommand
2020

2121
public function __construct(
2222
private PhpcrConsoleDumperHelper $consoleDumper,
23-
private int $dumpMaxLineLength
23+
private int $dumpMaxLineLength,
2424
) {
2525
parent::__construct(self::NAME);
2626
}

src/Command/RepositoryInitCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class RepositoryInitCommand extends Command
1919
private const NAME = 'doctrine:phpcr:repository:init';
2020

2121
public function __construct(
22-
private InitializerManager $initializerManager
22+
private InitializerManager $initializerManager,
2323
) {
2424
parent::__construct(self::NAME);
2525
}

src/DataFixtures/PHPCRExecutor.php

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Doctrine\Bundle\PHPCRBundle\DataFixtures;
44

55
use Doctrine\Bundle\PHPCRBundle\Initializer\InitializerManager;
6+
use Doctrine\Common\DataFixtures\Executor\AbstractExecutor;
67
use Doctrine\Common\DataFixtures\Executor\PHPCRExecutor as BasePHPCRExecutor;
78
use Doctrine\Common\DataFixtures\Purger\PHPCRPurger;
89
use Doctrine\ODM\PHPCR\DocumentManagerInterface;
@@ -12,14 +13,17 @@
1213
*
1314
* @author Daniel Leech <[email protected]>
1415
*/
15-
final class PHPCRExecutor extends BasePHPCRExecutor
16+
final class PHPCRExecutor extends AbstractExecutor
1617
{
18+
private BasePHPCRExecutor $wrappedExecutor;
19+
1720
public function __construct(
1821
DocumentManagerInterface $dm,
1922
?PHPCRPurger $purger = null,
20-
private ?InitializerManager $initializerManager = null
23+
private ?InitializerManager $initializerManager = null,
2124
) {
22-
parent::__construct($dm, $purger);
25+
parent::__construct($dm);
26+
$this->wrappedExecutor = new BasePHPCRExecutor($dm, $purger);
2327
}
2428

2529
public function purge(): void
@@ -31,4 +35,14 @@ public function purge(): void
3135
$this->initializerManager->initialize();
3236
}
3337
}
38+
39+
public function execute(array $fixtures, bool $append = false): void
40+
{
41+
$this->wrappedExecutor->execute($fixtures, $append);
42+
}
43+
44+
public function getObjectManager(): DocumentManagerInterface
45+
{
46+
return $this->wrappedExecutor->getObjectManager();
47+
}
3448
}

src/EventListener/JackalopeDoctrineDbalSchemaListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
class JackalopeDoctrineDbalSchemaListener
1919
{
2020
public function __construct(
21-
private RepositorySchema $schema
21+
private RepositorySchema $schema,
2222
) {
2323
}
2424

src/ManagerRegistry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __construct(
2222
array $entityManagers,
2323
string $defaultConnectionName,
2424
string $defaultEntityManagerName,
25-
string $proxyInterfaceName
25+
string $proxyInterfaceName,
2626
) {
2727
$this->container = $container;
2828

src/OptionalCommand/ODM/LoadFixtureCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class LoadFixtureCommand extends BaseCommand
2828
private const NAME = 'doctrine:phpcr:fixtures:load';
2929

3030
public function __construct(
31-
private InitializerManager $initializerManager
31+
private InitializerManager $initializerManager,
3232
) {
3333
parent::__construct(self::NAME);
3434
}

0 commit comments

Comments
 (0)