Skip to content

Commit

Permalink
Cleanup AnnotationReader ignored namespace in favor of ignored name
Browse files Browse the repository at this point in the history
  • Loading branch information
danieltoader committed Jun 24, 2022
1 parent 8c2a6c5 commit 7914525
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions src/DependencyInjection/Compiler/CacheCompilerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,13 @@ private function isFromIgnoredNamespace(ContainerBuilder $container, string $cla
private function setCachedDefinitions(Definition $definition, ContainerBuilder $container, $serviceId): void
{
$annotationReader = new AnnotationReader();
AnnotationReader::addGlobalIgnoredNamespace('required');
AnnotationReader::addGlobalIgnoredNamespace('legacy');
$ignoreNames = $container->getParameter('annotation_cache.ignore.names');
foreach ($ignoreNames as $ignoreName) {
AnnotationReader::addGlobalIgnoredName($ignoreName);
}
$proxyWarmupDefinition = $container->getDefinition('annotation_cache.warmup');
/** @var Reader $annotationReaderReference */
$annotationReaderReference = new Reference("annotation_cache_reader");
$annotationReaderReference = new Reference("annotation_cache.cache_reader");
/** @var CacheFactory $cacheProxyFactory */
$cacheProxyFactory = new Reference('annotation_cache.proxy.factory');
/** @var ServiceLocator $cacheServiceReference */
Expand Down
8 changes: 4 additions & 4 deletions src/Resources/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ parameters:
annotation_cache.proxy.cache-locator.class: Symfony\Component\DependencyInjection\ServiceLocator

services:
annotation_reader:
annotation_cache.annotation_reader:
class: Doctrine\Common\Annotations\AnnotationReader
annotation_cache_reader:
annotation_cache.cache_reader:
class: EmagTechLabs\AnnotationCacheBundle\Annotation\CacheReader
arguments:
$reader: '@annotation_reader'
$reader: '@annotation_cache.annotation_reader'
annotation_cache.warmup:
class: '%annotation_cache.proxy.warmer.class%'
calls:
Expand All @@ -36,7 +36,7 @@ services:
annotation_cache.proxy.generator:
class: '%annotation_cache.proxy.generator.class%'
calls:
- [ 'setAnnotationCacheReader', [ "@annotation_cache_reader" ] ]
- [ 'setAnnotationCacheReader', [ "@annotation_cache.cache_reader" ] ]
public: false
annotation_cache.proxy.config:
class: '%annotation_cache.proxy.configuration.class%'
Expand Down

0 comments on commit 7914525

Please sign in to comment.