Skip to content

Commit 62ec878

Browse files
Merge branch '4.4' into 5.2
* 4.4: Stop using deprecated ArrayCache from Doctrine [Intl] fix Locale::getFallback() throwing exception on long $locale
2 parents 6baac52 + 1c2d159 commit 62ec878

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,8 +1443,8 @@ private function registerAnnotationsConfiguration(array $config, ContainerBuilde
14431443
}
14441444

14451445
$container
1446-
->getDefinition('annotations.filesystem_cache')
1447-
->replaceArgument(0, $cacheDir)
1446+
->getDefinition('annotations.filesystem_cache_adapter')
1447+
->replaceArgument(2, $cacheDir)
14481448
;
14491449

14501450
$cacheService = 'annotations.filesystem_cache';

Resources/config/annotations.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
use Doctrine\Common\Annotations\AnnotationRegistry;
1616
use Doctrine\Common\Annotations\CachedReader;
1717
use Doctrine\Common\Annotations\Reader;
18-
use Doctrine\Common\Cache\ArrayCache;
19-
use Doctrine\Common\Cache\FilesystemCache;
2018
use Symfony\Bundle\FrameworkBundle\CacheWarmer\AnnotationsCacheWarmer;
19+
use Symfony\Component\Cache\Adapter\ArrayAdapter;
20+
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
2121
use Symfony\Component\Cache\Adapter\PhpArrayAdapter;
2222
use Symfony\Component\Cache\DoctrineProvider;
2323

@@ -35,15 +35,24 @@
3535
->set('annotations.cached_reader', CachedReader::class)
3636
->args([
3737
service('annotations.reader'),
38-
inline_service(ArrayCache::class),
38+
inline_service(DoctrineProvider::class)->args([
39+
inline_service(ArrayAdapter::class)
40+
]),
3941
abstract_arg('Debug-Flag'),
4042
])
4143

42-
->set('annotations.filesystem_cache', FilesystemCache::class)
44+
->set('annotations.filesystem_cache_adapter', FilesystemAdapter::class)
4345
->args([
46+
'',
47+
0,
4448
abstract_arg('Cache-Directory'),
4549
])
4650

51+
->set('annotations.filesystem_cache', DoctrineProvider::class)
52+
->args([
53+
service('annotations.filesystem_cache_adapter'),
54+
])
55+
4756
->set('annotations.cache_warmer', AnnotationsCacheWarmer::class)
4857
->args([
4958
service('annotations.reader'),

Tests/DependencyInjection/FrameworkExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ public function testAnnotations()
928928
$container->addCompilerPass(new TestAnnotationsPass());
929929
$container->compile();
930930

931-
$this->assertEquals($container->getParameter('kernel.cache_dir').'/annotations', $container->getDefinition('annotations.filesystem_cache')->getArgument(0));
931+
$this->assertEquals($container->getParameter('kernel.cache_dir').'/annotations', $container->getDefinition('annotations.filesystem_cache_adapter')->getArgument(2));
932932
$this->assertSame('annotations.filesystem_cache', (string) $container->getDefinition('annotation_reader')->getArgument(1));
933933
}
934934

0 commit comments

Comments
 (0)