From f8019eb790a24c10ed1da6749e01eca774ed99ab Mon Sep 17 00:00:00 2001 From: bidi Date: Tue, 23 Jan 2024 15:00:12 +0200 Subject: [PATCH 1/5] updated dependencies --- README.md | 2 +- composer.json | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8329732..f0331d6 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ DotKernel component used to create services through [Laminas Service Manager](ht This package can clean up your code, by getting rid of all the factories you write, sometimes just to inject a dependency or two. ![OSS Lifecycle](https://img.shields.io/osslifecycle/dotkernel/dot-annotated-services) -![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-annotated-services/4.1.4) +![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-annotated-services/4.1.5) [![GitHub issues](https://img.shields.io/github/issues/dotkernel/dot-annotated-services)](https://github.com/dotkernel/dot-annotated-services/issues) [![GitHub forks](https://img.shields.io/github/forks/dotkernel/dot-annotated-services)](https://github.com/dotkernel/dot-annotated-services/network) diff --git a/composer.json b/composer.json index 3b2b671..37d6284 100644 --- a/composer.json +++ b/composer.json @@ -21,14 +21,14 @@ ], "require": { "php": "~8.1.0 || ~8.2.0 || ~8.3.0", - "laminas/laminas-servicemanager": "^3.10", - "doctrine/annotations": "^1.13", - "doctrine/cache": "^1.13", - "doctrine/orm" : "^2.11" + "laminas/laminas-servicemanager": "^3.22.1", + "doctrine/annotations": "^2.0.1", + "doctrine/cache": "^2.2.0", + "doctrine/orm" : "^2.17.3" }, "require-dev": { - "phpunit/phpunit": "^10.2", - "vimeo/psalm": "^5.13", + "phpunit/phpunit": "^10.5.9", + "vimeo/psalm": "^5.20", "laminas/laminas-coding-standard": "^2.5" }, "autoload": { From fe7ab465f7025cc497711708915d006c1b73fd8b Mon Sep 17 00:00:00 2001 From: bidi Date: Tue, 23 Jan 2024 15:45:51 +0200 Subject: [PATCH 2/5] fix for doctrine/annotations v2 deprecations --- src/Factory/AbstractAnnotatedFactory.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Factory/AbstractAnnotatedFactory.php b/src/Factory/AbstractAnnotatedFactory.php index 5700a13..3e19c6e 100644 --- a/src/Factory/AbstractAnnotatedFactory.php +++ b/src/Factory/AbstractAnnotatedFactory.php @@ -6,7 +6,7 @@ use Doctrine\Common\Annotations\AnnotationReader; use Doctrine\Common\Annotations\AnnotationRegistry; -use Doctrine\Common\Annotations\CachedReader; +use Doctrine\Common\Annotations\PsrCachedReader; use Doctrine\Common\Annotations\Reader; use Doctrine\Common\Cache\Cache; use Psr\Container\ContainerExceptionInterface; @@ -32,8 +32,6 @@ protected function createAnnotationReader(ContainerInterface $container): Reader return $this->annotationReader; } - AnnotationRegistry::registerLoader('class_exists'); - if (! $container->has(self::CACHE_SERVICE)) { return $this->annotationReader = new AnnotationReader(); } else { @@ -46,7 +44,7 @@ protected function createAnnotationReader(ContainerInterface $container): Reader $debug = (bool) $config['debug']; } } - return $this->annotationReader = new CachedReader(new AnnotationReader(), $cache, $debug); + return $this->annotationReader = new PsrCachedReader(new AnnotationReader(), $cache, $debug); } } } From a14a90bbbd0f5bc7e7d6f6fc810abcb004196704 Mon Sep 17 00:00:00 2001 From: bidi Date: Tue, 23 Jan 2024 15:58:36 +0200 Subject: [PATCH 3/5] fix for doctrine/annotations v2 deprecations --- src/Factory/AbstractAnnotatedFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Factory/AbstractAnnotatedFactory.php b/src/Factory/AbstractAnnotatedFactory.php index 3e19c6e..b9398e4 100644 --- a/src/Factory/AbstractAnnotatedFactory.php +++ b/src/Factory/AbstractAnnotatedFactory.php @@ -15,7 +15,7 @@ abstract class AbstractAnnotatedFactory { - public const CACHE_SERVICE = 'Dot\AnnotatedServices\Cache'; + public const CACHE_SERVICE = 'Psr\Cache\CacheItemPoolInterface'; protected ?Reader $annotationReader = null; public function setAnnotationReader(Reader $annotationReader): void { From 54c28afa7fd5ee46c556e8544cfdf8e2b54bdfe6 Mon Sep 17 00:00:00 2001 From: bidi Date: Tue, 23 Jan 2024 16:02:10 +0200 Subject: [PATCH 4/5] fix for doctrine/annotations v2 deprecations --- src/Factory/AbstractAnnotatedFactory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Factory/AbstractAnnotatedFactory.php b/src/Factory/AbstractAnnotatedFactory.php index b9398e4..713c9fc 100644 --- a/src/Factory/AbstractAnnotatedFactory.php +++ b/src/Factory/AbstractAnnotatedFactory.php @@ -5,17 +5,17 @@ namespace Dot\AnnotatedServices\Factory; use Doctrine\Common\Annotations\AnnotationReader; -use Doctrine\Common\Annotations\AnnotationRegistry; use Doctrine\Common\Annotations\PsrCachedReader; use Doctrine\Common\Annotations\Reader; use Doctrine\Common\Cache\Cache; +use Psr\Cache\CacheItemPoolInterface; use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerInterface; use Psr\Container\NotFoundExceptionInterface; abstract class AbstractAnnotatedFactory { - public const CACHE_SERVICE = 'Psr\Cache\CacheItemPoolInterface'; + const CACHE_SERVICE = CacheItemPoolInterface::class; protected ?Reader $annotationReader = null; public function setAnnotationReader(Reader $annotationReader): void { From 938720c8096aa9b7bf7918173f5ef9cf60a44b5c Mon Sep 17 00:00:00 2001 From: bidi Date: Tue, 23 Jan 2024 16:11:51 +0200 Subject: [PATCH 5/5] fix for doctrine/annotations v2 deprecations --- src/Factory/AbstractAnnotatedFactory.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Factory/AbstractAnnotatedFactory.php b/src/Factory/AbstractAnnotatedFactory.php index 713c9fc..bc4d523 100644 --- a/src/Factory/AbstractAnnotatedFactory.php +++ b/src/Factory/AbstractAnnotatedFactory.php @@ -7,7 +7,6 @@ use Doctrine\Common\Annotations\AnnotationReader; use Doctrine\Common\Annotations\PsrCachedReader; use Doctrine\Common\Annotations\Reader; -use Doctrine\Common\Cache\Cache; use Psr\Cache\CacheItemPoolInterface; use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerInterface; @@ -15,7 +14,7 @@ abstract class AbstractAnnotatedFactory { - const CACHE_SERVICE = CacheItemPoolInterface::class; + public const CACHE_SERVICE = CacheItemPoolInterface::class; protected ?Reader $annotationReader = null; public function setAnnotationReader(Reader $annotationReader): void { @@ -35,7 +34,7 @@ protected function createAnnotationReader(ContainerInterface $container): Reader if (! $container->has(self::CACHE_SERVICE)) { return $this->annotationReader = new AnnotationReader(); } else { - /** @var Cache $cache */ + /** @var CacheItemPoolInterface $cache */ $cache = $container->get(self::CACHE_SERVICE); $debug = false; if ($container->has('config')) {