From 945fbe7e4d0ee278011103394bfa68df2ac59264 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Mon, 13 Sep 2021 19:17:41 +0200 Subject: [PATCH] Remove remaining support for Doctrine Cache Signed-off-by: Alexander M. Turek --- composer.json | 1 - phpunit.xml.dist | 15 +++++++-------- .../DependencyInjection/Configuration.php | 7 +------ .../Resources/config/annotations.php | 15 --------------- src/Symfony/Bundle/FrameworkBundle/composer.json | 2 -- src/Symfony/Bundle/TwigBundle/composer.json | 3 +-- .../Component/Validator/ValidatorBuilder.php | 8 -------- src/Symfony/Component/Validator/composer.json | 2 -- 8 files changed, 9 insertions(+), 44 deletions(-) diff --git a/composer.json b/composer.json index ff0dc65b2efd0..084cbbce21336 100644 --- a/composer.json +++ b/composer.json @@ -123,7 +123,6 @@ "cache/integration-tests": "dev-master", "composer/package-versions-deprecated": "^1.8", "doctrine/annotations": "^1.13.1", - "doctrine/cache": "^1.11|^2.0", "doctrine/collections": "~1.0", "doctrine/data-fixtures": "^1.1", "doctrine/dbal": "^2.10|^3.0", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index b9f538ebc18a2..05776834693a5 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -72,14 +72,13 @@ Cache\IntegrationTests - Doctrine\Common\Cache - Symfony\Component\Cache - Symfony\Component\Cache\Tests\Fixtures - Symfony\Component\Cache\Tests\Traits - Symfony\Component\Cache\Traits - Symfony\Component\Console - Symfony\Component\HttpFoundation - Symfony\Component\Uid + Symfony\Component\Cache + Symfony\Component\Cache\Tests\Fixtures + Symfony\Component\Cache\Tests\Traits + Symfony\Component\Cache\Traits + Symfony\Component\Console + Symfony\Component\HttpFoundation + Symfony\Component\Uid diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index 38410287783cd..554bdb6bf3680 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -12,8 +12,6 @@ namespace Symfony\Bundle\FrameworkBundle\DependencyInjection; use Doctrine\Common\Annotations\Annotation; -use Doctrine\Common\Annotations\PsrCachedReader; -use Doctrine\Common\Cache\Cache; use Doctrine\DBAL\Connection; use Symfony\Bundle\FullStack; use Symfony\Component\Asset\Package; @@ -930,9 +928,6 @@ private function addValidationSection(ArrayNodeDefinition $rootNode, callable $e private function addAnnotationsSection(ArrayNodeDefinition $rootNode, callable $willBeAvailable) { - $doctrineCache = $willBeAvailable('doctrine/cache', Cache::class, 'doctrine/annotation'); - $psr6Cache = $willBeAvailable('symfony/cache', PsrCachedReader::class, 'doctrine/annotation'); - $rootNode ->children() ->arrayNode('annotations') @@ -941,7 +936,7 @@ private function addAnnotationsSection(ArrayNodeDefinition $rootNode, callable $ ->children() ->enumNode('cache') ->values(['none', 'php_array', 'file']) - ->defaultValue(($doctrineCache || $psr6Cache) ? 'php_array' : 'none') + ->defaultValue('php_array') ->end() ->scalarNode('file_cache_dir')->defaultValue('%kernel.cache_dir%/annotations')->end() ->booleanNode('debug')->defaultValue($this->debug)->end() diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/annotations.php b/src/Symfony/Bundle/FrameworkBundle/Resources/config/annotations.php index a8481258a83fa..fd25a3ab2fb2e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/annotations.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/annotations.php @@ -15,7 +15,6 @@ use Doctrine\Common\Annotations\AnnotationRegistry; use Doctrine\Common\Annotations\PsrCachedReader; use Doctrine\Common\Annotations\Reader; -use Doctrine\Common\Cache\Psr6\DoctrineProvider; use Symfony\Bundle\FrameworkBundle\CacheWarmer\AnnotationsCacheWarmer; use Symfony\Component\Cache\Adapter\ArrayAdapter; use Symfony\Component\Cache\Adapter\FilesystemAdapter; @@ -46,13 +45,6 @@ abstract_arg('Cache-Directory'), ]) - ->set('annotations.filesystem_cache', DoctrineProvider::class) - ->factory([DoctrineProvider::class, 'wrap']) - ->args([ - service('annotations.filesystem_cache_adapter'), - ]) - ->deprecate('symfony/framework-bundle', '5.4', '"%service_id% is deprecated"') - ->set('annotations.cache_warmer', AnnotationsCacheWarmer::class) ->args([ service('annotations.reader'), @@ -69,13 +61,6 @@ ]) ->tag('container.hot_path') - ->set('annotations.cache', DoctrineProvider::class) - ->factory([DoctrineProvider::class, 'wrap']) - ->args([ - service('annotations.cache_adapter'), - ]) - ->deprecate('symfony/framework-bundle', '5.4', '"%service_id% is deprecated"') - ->alias('annotation_reader', 'annotations.reader') ->alias(Reader::class, 'annotation_reader'); }; diff --git a/src/Symfony/Bundle/FrameworkBundle/composer.json b/src/Symfony/Bundle/FrameworkBundle/composer.json index 0f7097d544cc3..622baf3a52d43 100644 --- a/src/Symfony/Bundle/FrameworkBundle/composer.json +++ b/src/Symfony/Bundle/FrameworkBundle/composer.json @@ -32,7 +32,6 @@ }, "require-dev": { "doctrine/annotations": "^1.13.1", - "doctrine/cache": "^1.11|^2.0", "doctrine/persistence": "^1.3|^2.0", "symfony/asset": "^5.4|^6.0", "symfony/browser-kit": "^5.4|^6.0", @@ -69,7 +68,6 @@ }, "conflict": { "doctrine/annotations": "<1.13.1", - "doctrine/cache": "<1.11", "doctrine/persistence": "<1.3", "phpdocumentor/reflection-docblock": "<3.2.2", "phpdocumentor/type-resolver": "<1.4.0", diff --git a/src/Symfony/Bundle/TwigBundle/composer.json b/src/Symfony/Bundle/TwigBundle/composer.json index 4611c10dda35c..3ab1a1252a60b 100644 --- a/src/Symfony/Bundle/TwigBundle/composer.json +++ b/src/Symfony/Bundle/TwigBundle/composer.json @@ -37,8 +37,7 @@ "symfony/yaml": "^5.4|^6.0", "symfony/framework-bundle": "^5.4|^6.0", "symfony/web-link": "^5.4|^6.0", - "doctrine/annotations": "^1.10.4", - "doctrine/cache": "^1.0|^2.0" + "doctrine/annotations": "^1.10.4" }, "conflict": { "symfony/dependency-injection": "<5.4", diff --git a/src/Symfony/Component/Validator/ValidatorBuilder.php b/src/Symfony/Component/Validator/ValidatorBuilder.php index 82fb374b5a6e0..f6dc59976e77b 100644 --- a/src/Symfony/Component/Validator/ValidatorBuilder.php +++ b/src/Symfony/Component/Validator/ValidatorBuilder.php @@ -12,10 +12,8 @@ namespace Symfony\Component\Validator; use Doctrine\Common\Annotations\AnnotationReader; -use Doctrine\Common\Annotations\CachedReader; use Doctrine\Common\Annotations\PsrCachedReader; use Doctrine\Common\Annotations\Reader; -use Doctrine\Common\Cache\ArrayCache; use Psr\Cache\CacheItemPoolInterface; use Symfony\Component\Cache\Adapter\ArrayAdapter; use Symfony\Component\Validator\Context\ExecutionContextFactory; @@ -394,12 +392,6 @@ private function createAnnotationReader(): Reader return new PsrCachedReader(new AnnotationReader(), new ArrayAdapter()); } - if (class_exists(CachedReader::class) && class_exists(ArrayCache::class)) { - trigger_deprecation('symfony/validator', '5.4', 'Enabling annotation based constraint mapping without having symfony/cache installed is deprecated.'); - - return new CachedReader(new AnnotationReader(), new ArrayCache()); - } - throw new LogicException('Enabling annotation based constraint mapping requires the packages doctrine/annotations and symfony/cache to be installed.'); } } diff --git a/src/Symfony/Component/Validator/composer.json b/src/Symfony/Component/Validator/composer.json index fa6acc3ae5ed1..d6da361ec3203 100644 --- a/src/Symfony/Component/Validator/composer.json +++ b/src/Symfony/Component/Validator/composer.json @@ -38,12 +38,10 @@ "symfony/property-info": "^5.4|^6.0", "symfony/translation": "^5.4|^6.0", "doctrine/annotations": "^1.13", - "doctrine/cache": "^1.11|^2.0", "egulias/email-validator": "^2.1.10|^3" }, "conflict": { "doctrine/annotations": "<1.13", - "doctrine/cache": "<1.11", "doctrine/lexer": "<1.0.2", "phpunit/phpunit": "<5.4.3", "symfony/dependency-injection": "<5.4",