diff --git a/src/DependencyInjection/Compiler/ReaderPass.php b/src/DependencyInjection/Compiler/ReaderPass.php new file mode 100644 index 00000000..c092c7e2 --- /dev/null +++ b/src/DependencyInjection/Compiler/ReaderPass.php @@ -0,0 +1,27 @@ +has('annotation_reader')) { + $container->setAlias('.stof_doctrine_extensions.reader', new Alias('annotation_reader', false)); + + return; + } + + if (\PHP_VERSION_ID >= 80000) { + $container->register('.stof_doctrine_extensions.reader', AttributeReader::class); + } + } +} diff --git a/src/Resources/config/blameable.xml b/src/Resources/config/blameable.xml index a642e797..f0ac84ae 100644 --- a/src/Resources/config/blameable.xml +++ b/src/Resources/config/blameable.xml @@ -14,7 +14,7 @@ - + diff --git a/src/Resources/config/ip_traceable.xml b/src/Resources/config/ip_traceable.xml index df0dc1c7..d480f036 100644 --- a/src/Resources/config/ip_traceable.xml +++ b/src/Resources/config/ip_traceable.xml @@ -10,7 +10,7 @@ - + diff --git a/src/Resources/config/loggable.xml b/src/Resources/config/loggable.xml index e89a95ca..a8bd3146 100644 --- a/src/Resources/config/loggable.xml +++ b/src/Resources/config/loggable.xml @@ -14,7 +14,7 @@ - + diff --git a/src/Resources/config/reference_integrity.xml b/src/Resources/config/reference_integrity.xml index 80598b29..1bf70611 100644 --- a/src/Resources/config/reference_integrity.xml +++ b/src/Resources/config/reference_integrity.xml @@ -13,7 +13,7 @@ - + diff --git a/src/Resources/config/sluggable.xml b/src/Resources/config/sluggable.xml index fbe70db5..cb2839f3 100644 --- a/src/Resources/config/sluggable.xml +++ b/src/Resources/config/sluggable.xml @@ -13,7 +13,7 @@ - + diff --git a/src/Resources/config/softdeleteable.xml b/src/Resources/config/softdeleteable.xml index c8fba7ea..3f53141a 100644 --- a/src/Resources/config/softdeleteable.xml +++ b/src/Resources/config/softdeleteable.xml @@ -16,7 +16,7 @@ - + diff --git a/src/Resources/config/sortable.xml b/src/Resources/config/sortable.xml index 6bebef79..894a4502 100644 --- a/src/Resources/config/sortable.xml +++ b/src/Resources/config/sortable.xml @@ -13,7 +13,7 @@ - + diff --git a/src/Resources/config/timestampable.xml b/src/Resources/config/timestampable.xml index 9cc07c10..f5577efc 100644 --- a/src/Resources/config/timestampable.xml +++ b/src/Resources/config/timestampable.xml @@ -16,7 +16,7 @@ - + diff --git a/src/Resources/config/translatable.xml b/src/Resources/config/translatable.xml index dc19552b..008e15b0 100644 --- a/src/Resources/config/translatable.xml +++ b/src/Resources/config/translatable.xml @@ -14,7 +14,7 @@ - + %stof_doctrine_extensions.default_locale% diff --git a/src/Resources/config/tree.xml b/src/Resources/config/tree.xml index 74752204..d0e6cafe 100644 --- a/src/Resources/config/tree.xml +++ b/src/Resources/config/tree.xml @@ -13,7 +13,7 @@ - + diff --git a/src/Resources/config/uploadable.xml b/src/Resources/config/uploadable.xml index 43bc0a08..429e2fd7 100644 --- a/src/Resources/config/uploadable.xml +++ b/src/Resources/config/uploadable.xml @@ -19,7 +19,7 @@ - + diff --git a/src/StofDoctrineExtensionsBundle.php b/src/StofDoctrineExtensionsBundle.php index 8a9d56fb..2656f2ba 100644 --- a/src/StofDoctrineExtensionsBundle.php +++ b/src/StofDoctrineExtensionsBundle.php @@ -2,6 +2,7 @@ namespace Stof\DoctrineExtensionsBundle; +use Stof\DoctrineExtensionsBundle\DependencyInjection\Compiler\ReaderPass; use Stof\DoctrineExtensionsBundle\DependencyInjection\Compiler\ValidateExtensionConfigurationPass; use Symfony\Component\HttpKernel\Bundle\Bundle; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -16,5 +17,6 @@ class StofDoctrineExtensionsBundle extends Bundle public function build(ContainerBuilder $container) { $container->addCompilerPass(new ValidateExtensionConfigurationPass()); + $container->addCompilerPass(new ReaderPass()); } }