diff --git a/readme.md b/readme.md index 406a0ce..b44ad00 100644 --- a/readme.md +++ b/readme.md @@ -135,9 +135,9 @@ You can override services used internally, for example if you want to use a more ```yaml services: mycache: - class: Doctrine\Common\Cache\FilesystemCache + class: 'Doctrine\Common\Cache\FilesystemCache' arguments: - - '%kernel.cache_dir%/mycache' + $directory: '%kernel.cache_dir%/mycache' consistence.doctrine.enum.enum_fields_cache: '@mycache' ``` diff --git a/src/DependencyInjection/ConsistenceDoctrineExtension.php b/src/DependencyInjection/ConsistenceDoctrineExtension.php index 9433124..40e2571 100644 --- a/src/DependencyInjection/ConsistenceDoctrineExtension.php +++ b/src/DependencyInjection/ConsistenceDoctrineExtension.php @@ -46,7 +46,7 @@ public function prepend(ContainerBuilder $container): void public function load(array $configs, ContainerBuilder $container): void { $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/config')); - $loader->load('services.yml'); + $loader->load('services.yaml'); } public function getAlias(): string diff --git a/src/DependencyInjection/config/services.yaml b/src/DependencyInjection/config/services.yaml new file mode 100644 index 0000000..774991d --- /dev/null +++ b/src/DependencyInjection/config/services.yaml @@ -0,0 +1,15 @@ +services: + consistence.doctrine.enum.enum_post_load_entity_listener: + class: 'Consistence\Doctrine\Enum\EnumPostLoadEntityListener' + arguments: + $annotationReader: '@annotation_reader' + $enumFieldsCache: '@consistence.doctrine.enum.enum_fields_cache' + tags: + - + name: 'doctrine.event_listener' + event: 'postLoad' + + consistence.doctrine.enum.enum_fields_cache: '@consistence.doctrine.enum.enum_fields_cache_default' + + consistence.doctrine.enum.enum_fields_cache_default: + class: 'Doctrine\Common\Cache\ArrayCache' diff --git a/src/DependencyInjection/config/services.yml b/src/DependencyInjection/config/services.yml deleted file mode 100644 index 50798f7..0000000 --- a/src/DependencyInjection/config/services.yml +++ /dev/null @@ -1,13 +0,0 @@ -services: - consistence.doctrine.enum.enum_post_load_entity_listener: - class: Consistence\Doctrine\Enum\EnumPostLoadEntityListener - arguments: - - '@annotation_reader' - - '@consistence.doctrine.enum.enum_fields_cache' - tags: - - { name: doctrine.event_listener, event: postLoad } - - consistence.doctrine.enum.enum_fields_cache: '@consistence.doctrine.enum.enum_fields_cache_default' - - consistence.doctrine.enum.enum_fields_cache_default: - class: Doctrine\Common\Cache\ArrayCache