|
12 | 12 | namespace Symfony\Bundle\FrameworkBundle\DependencyInjection; |
13 | 13 |
|
14 | 14 | use Composer\InstalledVersions; |
15 | | -use Doctrine\Common\Annotations\Reader; |
16 | 15 | use Http\Client\HttpAsyncClient; |
17 | 16 | use Http\Client\HttpClient; |
18 | 17 | use phpDocumentor\Reflection\DocBlockFactoryInterface; |
@@ -255,7 +254,6 @@ public function load(array $configs, ContainerBuilder $container): void |
255 | 254 | $config = $this->processConfiguration($configuration, $configs); |
256 | 255 |
|
257 | 256 | // warmup config enabled |
258 | | - $this->readConfigEnabled('annotations', $container, $config['annotations']); |
259 | 257 | $this->readConfigEnabled('translator', $container, $config['translator']); |
260 | 258 | $this->readConfigEnabled('property_access', $container, $config['property_access']); |
261 | 259 | $this->readConfigEnabled('profiler', $container, $config['profiler']); |
@@ -363,7 +361,6 @@ public function load(array $configs, ContainerBuilder $container): void |
363 | 361 | $this->registerWorkflowConfiguration($config['workflows'], $container, $loader); |
364 | 362 | $this->registerDebugConfiguration($config['php_errors'], $container, $loader); |
365 | 363 | $this->registerRouterConfiguration($config['router'], $container, $loader, $config['enabled_locales']); |
366 | | - $this->registerAnnotationsConfiguration($config['annotations'], $container, $loader); |
367 | 364 | $this->registerPropertyAccessConfiguration($config['property_access'], $container, $loader); |
368 | 365 | $this->registerSecretsConfiguration($config['secrets'], $container, $loader); |
369 | 366 |
|
@@ -1600,10 +1597,7 @@ private function registerValidationConfiguration(array $config, ContainerBuilder |
1600 | 1597 | $definition->replaceArgument(0, $config['email_validation_mode']); |
1601 | 1598 |
|
1602 | 1599 | if (\array_key_exists('enable_annotations', $config<
5044
/span>) && $config['enable_annotations']) { |
1603 | | - $validatorBuilder->addMethodCall('enableAnnotationMapping', [true]); |
1604 | | - if ($this->isInitializedConfigEnabled('annotations')) { |
1605 | | - $validatorBuilder->addMethodCall('setDoctrineAnnotationReader', [new Reference('annotation_reader')]); |
1606 | | - } |
| 1600 | + $validatorBuilder->addMethodCall('enableAnnotationMapping'); |
1607 | 1601 | } |
1608 | 1602 |
|
1609 | 1603 | if (\array_key_exists('static_method', $config) && $config['static_method']) { |
@@ -1698,58 +1692,6 @@ private function registerMappingFilesFromConfig(ContainerBuilder $container, arr |
1698 | 1692 | } |
1699 | 1693 | } |
1700 | 1694 |
|
1701 | | - private function registerAnnotationsConfiguration(array $config, ContainerBuilder $container, LoaderInterface $loader): void |
1702 | | - { |
1703 | | - if (!$this->isInitializedConfigEnabled('annotations')) { |
1704 | | - return; |
1705 | | - } |
1706 | | - |
1707 | | - if (!class_exists(\Doctrine\Common\Annotations\Annotation::class)) { |
1708 | | - throw new LogicException('Annotations cannot be enabled as the Doctrine Annotation library is not installed. Try running "composer require doctrine/annotations".'); |
1709 | | - } |
1710 | | - |
1711 | | - trigger_deprecation('symfony/framework-bundle', '6.4', 'Enabling the integration of Doctrine annotations is deprecated. Set the "framework.annotations.enabled" config option to false.'); |
1712 | | - |
1713 | | - $loader->load('annotations.php'); |
1714 | | - |
1715 | | - if ('none' === $config['cache']) { |
1716 | | - $container->removeDefinition('annotations.cached_reader'); |
1717 | | - |
1718 | | - return; |
1719 | | - } |
1720 | | - |
1721 | | - if ('php_array' === $config['cache']) { |
1722 | | - $cacheService = 'annotations.cache_adapter'; |
1723 | | - |
1724 | | - // Enable warmer only if PHP array is used for cache |
1725 | | - $definition = $container->findDefinition('annotations.cache_warmer'); |
1726 | | - $definition->addTag('kernel.cache_warmer'); |
1727 | | - } else { |
1728 | | - $cacheService = 'annotations.filesystem_cache_adapter'; |
1729 | | - $cacheDir = $container->getParameterBag()->resolveValue($config['file_cache_dir']); |
1730 | | - |
1731 | | - if (!is_dir($cacheDir) && false === @mkdir($cacheDir, 0777, true) && !is_dir($cacheDir)) { |
1732 | | - throw new \RuntimeException(sprintf('Could not create cache directory "%s".', $cacheDir)); |
1733 | | - } |
1734 | | - |
1735 | | - $container |
1736 | | - ->getDefinition('annotations.filesystem_cache_adapter') |
1737 | | - ->replaceArgument(2, $cacheDir) |
1738 | | - ; |
1739 | | - } |
1740 | | - |
1741 | | - $container |
1742 | | - ->getDefinition('annotations.cached_reader') |
1743 | | - ->replaceArgument(2, $config['debug']) |
1744 | | - // reference the cache provider without using it until AddAnnotationsCachedReaderPass runs |
1745 | | - ->addArgument(new ServiceClosureArgument(new Reference($cacheService))) |
1746 | | - ; |
1747 | | - |
1748 | | - $container->setAlias('annotation_reader', 'annotations.cached_reader'); |
1749 | | - $container->setAlias(Reader::class, new Alias('annotations.cached_reader', false)); |
1750 | | - $container->removeDefinition('annotations.psr_cached_reader'); |
1751 | | - } |
1752 | | - |
1753 | 1695 | private function registerPropertyAccessConfiguration(array $config, ContainerBuilder $container, PhpFileLoader $loader): void |
1754 | 1696 | { |
1755 | 1697 | if (!$this->readConfigEnabled('property_access', $container, $config)) { |
|
0 commit comments