From 946539f6dc2c61900ce0b31e2bfd342c61e42cd3 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Tue, 20 Dec 2022 18:17:24 +0100 Subject: [PATCH 1/2] Compatibility with Annotations 2 --- composer.json | 2 +- src/Plugin.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 06c8a4b1..325175d1 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ }, "require-dev": { "symfony/form": "^4.0 || ^5.0 || ^6.0", - "doctrine/annotations": "^1.8", + "doctrine/annotations": "^1.8|^2", "doctrine/orm": "^2.7", "phpunit/phpunit": "~7.5 || ~9.5", "symfony/cache-contracts": "^1.0 || ^2.0", diff --git a/src/Plugin.php b/src/Plugin.php index b82be3a0..2afcbee6 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -54,8 +54,10 @@ public function __invoke(RegistrationInterface $api, SimpleXMLElement $config = if (class_exists(AnnotationRegistry::class)) { require_once __DIR__.'/Handler/DoctrineRepositoryHandler.php'; - /** @psalm-suppress DeprecatedMethod */ - AnnotationRegistry::registerLoader('class_exists'); + if (method_exists(AnnotationRegistry::class, 'registerLoader')) { + /** @psalm-suppress DeprecatedMethod */ + AnnotationRegistry::registerLoader('class_exists'); + } $api->registerHooksFromClass(DoctrineRepositoryHandler::class); require_once __DIR__.'/Handler/AnnotationHandler.php'; From 15f4d043a685725050eaae884368d716c821ae51 Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Fri, 23 Dec 2022 00:02:46 -0400 Subject: [PATCH 2/2] Suppress UnusedPsalmSuppress --- psalm-baseline.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 30800ce4..b40e5133 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,10 @@ + + + DeprecatedMethod + + int