Skip to content

Commit 1c2d159

Browse files
Stop using deprecated ArrayCache from Doctrine
1 parent c8e4a78 commit 1c2d159

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

DependencyInjection/FrameworkExtension.php

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

14491449
$container
1450-
->getDefinition('annotations.filesystem_cache')
1451-
->replaceArgument(0, $cacheDir)
1450+
->getDefinition('annotations.filesystem_cache_adapter')
1451+
->replaceArgument(2, $cacheDir)
14521452
;
14531453

14541454
$cacheService = 'annotations.filesystem_cache';

Resources/config/annotations.xml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,25 @@
2424
<service id="annotations.cached_reader" class="Doctrine\Common\Annotations\CachedReader">
2525
<argument type="service" id="annotations.reader" />
2626
<argument type="service">
27-
<service class="Doctrine\Common\Cache\ArrayCache" />
27+
<service class="Symfony\Component\Cache\DoctrineProvider">
28+
<argument type="service">
29+
<service class="Symfony\Component\Cache\Adapter\ArrayAdapter" />
30+
</argument>
31+
</service>
2832
</argument>
2933
<argument /><!-- Debug-Flag -->
3034
</service>
3135

32-
<service id="annotations.filesystem_cache" class="Doctrine\Common\Cache\FilesystemCache">
36+
<service id="annotations.filesystem_cache_adapter" class="Symfony\Component\Cache\Adapter\FilesystemAdapter">
37+
<argument />
38+
<argument>0</argument>
3339
<argument /><!-- Cache-Directory -->
3440
</service>
3541

42+
<service id="annotations.filesystem_cache" class="Symfony\Component\Cache\DoctrineProvider">
43+
<argument type="service" id="annotations.filesystem_cache_adapter" />
44+
</service>
45+
3646
<service id="annotations.cache_warmer" class="Symfony\Bundle\FrameworkBundle\CacheWarmer\AnnotationsCacheWarmer">
3747
<argument type="service" id="annotations.reader" />
3848
<argument>%kernel.cache_dir%/annotations.php</argument>

Tests/DependencyInjection/FrameworkExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ public function testAnnotations()
997997
$container->addCompilerPass(new TestAnnotationsPass());
998998
$container->compile();
999999

1000-
$this->assertEquals($container->getParameter('kernel.cache_dir').'/annotations', $container->getDefinition('annotations.filesystem_cache')->getArgument(0));
1000+
$this->assertEquals($container->getParameter('kernel.cache_dir').'/annotations', $container->getDefinition('annotations.filesystem_cache_adapter')->getArgument(2));
10011001
$this->assertSame('annotations.filesystem_cache', (string) $container->getDefinition('annotation_reader')->getArgument(1));
10021002
}
10031003

0 commit comments

Comments
 (0)