From 7606878062057a8b54b612125bab2eae18d90894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Tue, 21 May 2024 18:05:59 +0200 Subject: [PATCH 1/4] Upgrade to doctrine/coding-standard v12 (#363) --- composer.json | 2 +- src/Persistence/AbstractManagerRegistry.php | 20 +++++++++---------- .../Mapping/Driver/StaticPHPDriver.php | 4 ++-- src/Persistence/ObjectManagerDecorator.php | 8 ++++---- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/composer.json b/composer.json index db9f82e5..0020da9d 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "phpstan/phpstan": "1.9.4", "phpstan/phpstan-phpunit": "^1", "phpstan/phpstan-strict-rules": "^1.1", - "doctrine/coding-standard": "^11", + "doctrine/coding-standard": "^12", "doctrine/common": "^3.0", "phpunit/phpunit": "^8.5 || ^9.5", "symfony/cache": "^4.4 || ^5.4 || ^6.0", diff --git a/src/Persistence/AbstractManagerRegistry.php b/src/Persistence/AbstractManagerRegistry.php index 72142ab0..0586c364 100644 --- a/src/Persistence/AbstractManagerRegistry.php +++ b/src/Persistence/AbstractManagerRegistry.php @@ -89,7 +89,7 @@ public function getName() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getConnection(?string $name = null) { @@ -107,7 +107,7 @@ public function getConnection(?string $name = null) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getConnectionNames() { @@ -115,7 +115,7 @@ public function getConnectionNames() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getConnections() { @@ -128,7 +128,7 @@ public function getConnections() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getDefaultConnectionName() { @@ -136,7 +136,7 @@ public function getDefaultConnectionName() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getDefaultManagerName() { @@ -144,7 +144,7 @@ public function getDefaultManagerName() } /** - * {@inheritdoc} + * {@inheritDoc} * * @throws InvalidArgumentException */ @@ -195,7 +195,7 @@ public function getManagerForClass(string $class) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getManagerNames() { @@ -203,7 +203,7 @@ public function getManagerNames() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getManagers() { @@ -218,7 +218,7 @@ public function getManagers() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getRepository( string $persistentObject, @@ -230,7 +230,7 @@ public function getRepository( } /** - * {@inheritdoc} + * {@inheritDoc} */ public function resetManager(?string $name = null) { diff --git a/src/Persistence/Mapping/Driver/StaticPHPDriver.php b/src/Persistence/Mapping/Driver/StaticPHPDriver.php index d3974435..bbcff757 100644 --- a/src/Persistence/Mapping/Driver/StaticPHPDriver.php +++ b/src/Persistence/Mapping/Driver/StaticPHPDriver.php @@ -56,7 +56,7 @@ public function addPaths(array $paths) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function loadMetadataForClass(string $className, ClassMetadata $metadata) { @@ -123,7 +123,7 @@ public function getAllClassNames() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function isTransient(string $className) { diff --git a/src/Persistence/ObjectManagerDecorator.php b/src/Persistence/ObjectManagerDecorator.php index 5855a338..8c038b8e 100644 --- a/src/Persistence/ObjectManagerDecorator.php +++ b/src/Persistence/ObjectManagerDecorator.php @@ -18,7 +18,7 @@ abstract class ObjectManagerDecorator implements ObjectManager protected $wrapped; /** - * {@inheritdoc} + * {@inheritDoc} */ public function find(string $className, $id) { @@ -56,7 +56,7 @@ public function flush() } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getRepository(string $className) { @@ -64,7 +64,7 @@ public function getRepository(string $className) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getClassMetadata(string $className) { @@ -83,7 +83,7 @@ public function initializeObject(object $obj) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function contains(object $object) { From 8cd3e450a535aef6edfaeeb12f4d215cd166ec50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Tue, 21 May 2024 18:06:29 +0200 Subject: [PATCH 2/4] Upgrade to PHPStan 1.11.1 (#364) Some messages change slightly, and one error disappears. --- composer.json | 2 +- phpstan-baseline.neon | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 0020da9d..f35ca2a2 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ }, "require-dev": { "composer/package-versions-deprecated": "^1.11", - "phpstan/phpstan": "1.9.4", + "phpstan/phpstan": "1.11.1", "phpstan/phpstan-phpunit": "^1", "phpstan/phpstan-strict-rules": "^1.1", "doctrine/coding-standard": "^12", diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index c838cdd0..fed7f899 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -15,11 +15,6 @@ parameters: count: 1 path: src/Persistence/Reflection/EnumReflectionProperty.php - - - message: "#^Method Doctrine\\\\Persistence\\\\Reflection\\\\EnumReflectionProperty\\:\\:getType\\(\\) should return ReflectionNamedType\\|ReflectionUnionType\\|null but returns ReflectionType\\|null\\.$#" - count: 1 - path: src/Persistence/Reflection/EnumReflectionProperty.php - - message: "#^Method Doctrine\\\\Persistence\\\\Reflection\\\\EnumReflectionProperty\\:\\:toEnum\\(\\) should return array\\\\|BackedEnum but returns array\\\\.$#" count: 1 @@ -46,17 +41,17 @@ parameters: path: tests/Persistence/Mapping/DriverChainTest.php - - message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with array\\{'Foo\\\\\\\\Bar\\\\\\\\subDirClass', 'Foo\\\\\\\\global', 'Foo\\\\\\\\stdClass'\\} and array\\ will always evaluate to false\\.$#" + message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with array\\{'Foo\\\\\\\\stdClass', 'Foo\\\\\\\\sub\\\\\\\\subClass', 'Foo\\\\\\\\sub\\\\\\\\subsub…'\\} and array\\ will always evaluate to false\\.$#" count: 1 path: tests/Persistence/Mapping/SymfonyFileLocatorTest.php - - message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with array\\{'Foo\\\\\\\\Bar\\\\\\\\subDirClass', 'Foo\\\\\\\\stdClass'\\} and array\\ will always evaluate to false\\.$#" + message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with non\\-empty\\-array\\ and array\\ will always evaluate to false\\.$#" count: 1 path: tests/Persistence/Mapping/SymfonyFileLocatorTest.php - - message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with array\\{'Foo\\\\\\\\stdClass', 'Foo\\\\\\\\sub\\\\\\\\subClass', 'Foo\\\\\\\\sub\\\\\\\\subsub…'\\} and array\\ will always evaluate to false\\.$#" + message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with non\\-empty\\-array\\ and array\\ will always evaluate to false\\.$#" count: 1 path: tests/Persistence/Mapping/SymfonyFileLocatorTest.php From 257151790adba67adb9d3cf9e189c26dc7a93be0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Tue, 21 May 2024 18:06:50 +0200 Subject: [PATCH 3/4] Explictly configure new Psalm options (#365) It warns about default values that might not suit us coming with Psalm v6. --- psalm.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/psalm.xml b/psalm.xml index b50074aa..bd5fbbf9 100644 --- a/psalm.xml +++ b/psalm.xml @@ -2,6 +2,8 @@ Date: Tue, 21 May 2024 18:37:27 +0200 Subject: [PATCH 4/4] Remove composer/package-versions-deprecated (#366) --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index f35ca2a2..03d832fe 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,6 @@ "psr/cache": "^1.0 || ^2.0 || ^3.0" }, "require-dev": { - "composer/package-versions-deprecated": "^1.11", "phpstan/phpstan": "1.11.1", "phpstan/phpstan-phpunit": "^1", "phpstan/phpstan-strict-rules": "^1.1",