Skip to content

Commit

Permalink
DI and config refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
VasekPurchart committed Nov 27, 2024
2 parents 876b986 + 432d51d commit 9996969
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
```
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/ConsistenceDoctrineExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions src/DependencyInjection/config/services.yaml
Original file line number Diff line number Diff line change
@@ -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'
13 changes: 0 additions & 13 deletions src/DependencyInjection/config/services.yml

This file was deleted.

0 comments on commit 9996969

Please sign in to comment.