From da59ff29ce37f102fbf857e0535d2b71ed9d882b Mon Sep 17 00:00:00 2001 From: W0rma Date: Fri, 27 Jan 2023 13:44:42 +0100 Subject: [PATCH 1/3] Allow installation of doctrine/annotations:^2.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0de7fee..fc57d1a 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ ], "require": { "php": "^7.2 | ^8.0", - "doctrine/annotations": "^1.13.2", + "doctrine/annotations": "^1.13.2 || ^2.0", "jms/metadata": "^2.0", "jms/serializer": "^3.18.2", "symfony/expression-language": "~3.0 || ~4.0 || ~5.0 || ~6.0" From 8dbebb14b32094fed38bdf873240e7f9ee8d2b6e Mon Sep 17 00:00:00 2001 From: W0rma Date: Fri, 27 Jan 2023 13:48:30 +0100 Subject: [PATCH 2/3] Allow newer versions of doctrine/persistence in dev --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index fc57d1a..370f410 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "require-dev": { "phpunit/phpunit": "^7 | ^9.5.10", "doctrine/coding-standard": "^5.0 | ^8.0", - "doctrine/persistence": "^1.3.4", + "doctrine/persistence": "^1.3.4 | ^2.0 | ^3.0", "pagerfanta/core": "^2.4 || ^3.0", "phpdocumentor/type-resolver": "^1.5.1", "phpspec/prophecy-phpunit": "^2.0.1", From 57be209ccf374aca5b617ce4f42fb3e713f037b3 Mon Sep 17 00:00:00 2001 From: W0rma Date: Mon, 30 Jan 2023 14:18:01 +0100 Subject: [PATCH 3/3] Call AnnotationRegistry::registerLoader() only if it exists --- tests/bootstrap.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index b9ea69a..1c624bf 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -18,4 +18,7 @@ $loader->add('Hateoas\Tests', __DIR__); -AnnotationRegistry::registerLoader('class_exists'); +// Method has been removed in doctrine/annotations:2 +if (method_exists(AnnotationRegistry::class, 'registerLoader')) { + AnnotationRegistry::registerLoader('class_exists'); +}