Skip to content

Remove remaining support for Doctrine Cache #43010

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
15 changes: 7 additions & 8 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,13 @@
<element key="time-sensitive">
<array>
<element key="0"><string>Cache\IntegrationTests</string></element>
<element key="1"><string>Doctrine\Common\Cache</string></element>
<element key="2"><string>Symfony\Component\Cache</string></element>
<element key="3"><string>Symfony\Component\Cache\Tests\Fixtures</string></element>
<element key="4"><string>Symfony\Component\Cache\Tests\Traits</string></element>
<element key="5"><string>Symfony\Component\Cache\Traits</string></element>
<element key="6"><string>Symfony\Component\Console</string></element>
<element key="7"><string>Symfony\Component\HttpFoundation</string></element>
<element key="8"><string>Symfony\Component\Uid</string></element>
<element key="1"><string>Symfony\Component\Cache</string></element>
<element key="2"><string>Symfony\Component\Cache\Tests\Fixtures</string></element>
<element key="3"><string>Symfony\Component\Cache\Tests\Traits</string></element>
<element key="4"><string>Symfony\Component\Cache\Traits</string></element>
<element key="5"><string>Symfony\Component\Console</string></element>
<element key="6"><string>Symfony\Component\HttpFoundation</string></element>
<element key="7"><string>Symfony\Component\Uid</string></element>
</array>
</element>
</array>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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')
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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'),
Expand All @@ -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');
};
2 changes: 0 additions & 2 deletions src/Symfony/Bundle/FrameworkBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions src/Symfony/Bundle/TwigBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 0 additions & 8 deletions src/Symfony/Component/Validator/ValidatorBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.');
}
}
2 changes: 0 additions & 2 deletions src/Symfony/Component/Validator/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down