From d1e1f7faa40d950298d1816887932803f59c814c Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Thu, 18 Nov 2021 08:34:17 +0100 Subject: [PATCH] Revert "fix: `Autowire` and `autoconfigure` services in `chill_main`." This reverts commit d7fbbbf92cfe5233130ed7d5c27aeb9364426436. --- .../ChillMainBundle/config/services.yaml | 7 ++++ .../config/services/cache.yaml | 4 --- .../config/services/command.yaml | 10 +++--- .../config/services/controller.yaml | 9 +++-- .../ChillMainBundle/config/services/crud.yaml | 4 --- .../config/services/doctrine.yaml | 6 +--- .../config/services/export.yaml | 15 ++++---- .../config/services/fixtures.yaml | 4 --- .../ChillMainBundle/config/services/form.yaml | 34 +++++++++++++++++-- .../config/services/logger.yaml | 4 --- .../ChillMainBundle/config/services/menu.yaml | 6 ++-- .../config/services/notification.yaml | 8 ++--- .../config/services/pagination.yaml | 6 ++-- .../config/services/phonenumber.yaml | 8 ++--- .../config/services/redis.yaml | 7 ++-- .../config/services/routing.yaml | 6 +--- .../config/services/search.yaml | 10 +++--- .../config/services/security.yaml | 25 ++++++++++++++ .../config/services/serializer.yaml | 4 +-- .../config/services/templating.yaml | 16 ++++++--- .../config/services/timeline.yaml | 4 --- .../config/services/validator.yaml | 6 +--- .../config/services/widget.yaml | 4 --- 23 files changed, 115 insertions(+), 92 deletions(-) diff --git a/src/Bundle/ChillMainBundle/config/services.yaml b/src/Bundle/ChillMainBundle/config/services.yaml index 916257335..f5f10cf57 100644 --- a/src/Bundle/ChillMainBundle/config/services.yaml +++ b/src/Bundle/ChillMainBundle/config/services.yaml @@ -8,21 +8,28 @@ services: Chill\MainBundle\Repository\: resource: '../Repository/' + autowire: true + autoconfigure: true Chill\MainBundle\Repository\UserACLAwareRepositoryInterface: '@Chill\MainBundle\Repository\UserACLAwareRepository' Chill\MainBundle\Serializer\Normalizer\: resource: '../Serializer/Normalizer' + autoconfigure: true + autowire: true tags: - { name: 'serializer.normalizer', priority: 64 } Chill\MainBundle\Form\Type\: resource: '../Form/Type' + autoconfigure: true + autowire: true tags: - { name: form.type } Chill\MainBundle\Doctrine\Event\: resource: '../Doctrine/Event/' + autowire: true tags: - { name: 'doctrine.event_subscriber' } diff --git a/src/Bundle/ChillMainBundle/config/services/cache.yaml b/src/Bundle/ChillMainBundle/config/services/cache.yaml index ce2bb3e08..de362ea30 100644 --- a/src/Bundle/ChillMainBundle/config/services/cache.yaml +++ b/src/Bundle/ChillMainBundle/config/services/cache.yaml @@ -1,8 +1,4 @@ services: - _defaults: - autowire: true - autoconfigure: true - chill_main.tag_aware_cache: class: Symfony\Component\Cache\Adapter\TagAwareAdapter arguments: diff --git a/src/Bundle/ChillMainBundle/config/services/command.yaml b/src/Bundle/ChillMainBundle/config/services/command.yaml index 87220bc1f..a005f9944 100644 --- a/src/Bundle/ChillMainBundle/config/services/command.yaml +++ b/src/Bundle/ChillMainBundle/config/services/command.yaml @@ -1,9 +1,11 @@ services: - _defaults: - autowire: true - autoconfigure: true - Chill\MainBundle\Command\ChillImportUsersCommand: + arguments: + $em: '@Doctrine\ORM\EntityManagerInterface' + $logger: '@Psr\Log\LoggerInterface' + $passwordEncoder: '@Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface' + $validator: '@Symfony\Component\Validator\Validator\ValidatorInterface' + $userRepository: '@Chill\MainBundle\Repository\UserRepository' tags: - { name: console.command } diff --git a/src/Bundle/ChillMainBundle/config/services/controller.yaml b/src/Bundle/ChillMainBundle/config/services/controller.yaml index 28abc94e8..a74755ffd 100644 --- a/src/Bundle/ChillMainBundle/config/services/controller.yaml +++ b/src/Bundle/ChillMainBundle/config/services/controller.yaml @@ -1,13 +1,12 @@ services: - _defaults: - autowire: true - autoconfigure: true Chill\MainBundle\Controller\: + autowire: true resource: '../../Controller' tags: ['controller.service_arguments'] Chill\MainBundle\Controller\PasswordController: + autowire: true arguments: $chillLogger: '@monolog.logger.chill' tags: ['controller.service_arguments'] @@ -29,6 +28,10 @@ services: $validator: '@Symfony\Component\Validator\Validator\ValidatorInterface' tags: ['controller.service_arguments'] + Chill\MainBundle\Controller\UserController: + autowire: true + autoconfigure: true + Chill\MainBundle\Controller\NotificationController: arguments: $security: '@Symfony\Component\Security\Core\Security' diff --git a/src/Bundle/ChillMainBundle/config/services/crud.yaml b/src/Bundle/ChillMainBundle/config/services/crud.yaml index 02533f433..5d1940a87 100644 --- a/src/Bundle/ChillMainBundle/config/services/crud.yaml +++ b/src/Bundle/ChillMainBundle/config/services/crud.yaml @@ -1,8 +1,4 @@ services: - _defaults: - autowire: true - autoconfigure: true - Chill\MainBundle\CRUD\Routing\CRUDRoutesLoader: arguments: $crudConfig: '%chill_main_crud_route_loader_config%' diff --git a/src/Bundle/ChillMainBundle/config/services/doctrine.yaml b/src/Bundle/ChillMainBundle/config/services/doctrine.yaml index e59088fc4..09b68f03b 100644 --- a/src/Bundle/ChillMainBundle/config/services/doctrine.yaml +++ b/src/Bundle/ChillMainBundle/config/services/doctrine.yaml @@ -1,7 +1,3 @@ --- services: - _defaults: - autowire: true - autoconfigure: true - - Chill\MainBundle\Doctrine\Migrations\VersionComparator: ~ + 'Chill\MainBundle\Doctrine\Migrations\VersionComparator': ~ diff --git a/src/Bundle/ChillMainBundle/config/services/export.yaml b/src/Bundle/ChillMainBundle/config/services/export.yaml index ce361677b..ac49199af 100644 --- a/src/Bundle/ChillMainBundle/config/services/export.yaml +++ b/src/Bundle/ChillMainBundle/config/services/export.yaml @@ -1,13 +1,9 @@ services: - _defaults: - autowire: true - autoconfigure: true - chill.main.export_element_validator: class: Chill\MainBundle\Validator\Constraints\Export\ExportElementConstraintValidator tags: - { name: validator.constraint_validator } - + # deprecated in favor of spreadsheet_formatter # chill.main.export.csv_formatter: # class: Chill\MainBundle\Export\Formatter\CSVFormatter @@ -15,7 +11,7 @@ services: # - "@translator" # tags: # - { name: chill.export_formatter, alias: 'csv' } - + chill.main.export.spreadsheet_formatter: class: Chill\MainBundle\Export\Formatter\SpreadSheetFormatter arguments: @@ -23,7 +19,7 @@ services: $exportManager: '@Chill\MainBundle\Export\ExportManager' tags: - { name: chill.export_formatter, alias: 'spreadsheet' } - + chill.main.export.list_formatter: class: Chill\MainBundle\Export\Formatter\CSVListFormatter arguments: @@ -31,7 +27,7 @@ services: $exportManager: '@Chill\MainBundle\Export\ExportManager' tags: - { name: chill.export_formatter, alias: 'csvlist' } - + chill.main.export.list_spreadsheet_formatter: class: Chill\MainBundle\Export\Formatter\SpreadsheetListFormatter arguments: @@ -39,7 +35,7 @@ services: $exportManager: '@Chill\MainBundle\Export\ExportManager' tags: - { name: chill.export_formatter, alias: 'spreadlist' } - + chill.main.export.pivoted_list_formatter: class: Chill\MainBundle\Export\Formatter\CSVPivotedListFormatter arguments: @@ -47,3 +43,4 @@ services: $exportManager: '@Chill\MainBundle\Export\ExportManager' tags: - { name: chill.export_formatter, alias: 'csv_pivoted_list' } + \ No newline at end of file diff --git a/src/Bundle/ChillMainBundle/config/services/fixtures.yaml b/src/Bundle/ChillMainBundle/config/services/fixtures.yaml index 29aabb25f..ccae65867 100644 --- a/src/Bundle/ChillMainBundle/config/services/fixtures.yaml +++ b/src/Bundle/ChillMainBundle/config/services/fixtures.yaml @@ -1,8 +1,4 @@ services: - _defaults: - autowire: true - autoconfigure: true - Chill\MainBundle\DataFixtures\ORM\: resource: ../../DataFixtures/ORM tags: [ 'doctrine.fixture.orm' ] diff --git a/src/Bundle/ChillMainBundle/config/services/form.yaml b/src/Bundle/ChillMainBundle/config/services/form.yaml index 843e03cb0..27d018229 100644 --- a/src/Bundle/ChillMainBundle/config/services/form.yaml +++ b/src/Bundle/ChillMainBundle/config/services/form.yaml @@ -1,7 +1,4 @@ services: - _defaults: - autowire: true - autoconfigure: true chill.main.form.type.translatable.string: class: Chill\MainBundle\Form\Type\TranslatableStringFormType @@ -42,6 +39,10 @@ services: tags: - { name: form.type, alias: select2_chill_language } + Chill\MainBundle\Form\Type\PickCenterType: + autowire: true + autoconfigure: true + chill.main.form.type.composed_role_scope: class: Chill\MainBundle\Form\Type\ComposedRoleScopeType arguments: @@ -61,6 +62,10 @@ services: tags: - { name: form.type } + Chill\MainBundle\Form\ChoiceLoader\PostalCodeChoiceLoader: + autowire: true + autoconfigure: true + chill.main.form.type.export: class: Chill\MainBundle\Form\Type\Export\ExportType tags: @@ -91,8 +96,14 @@ services: arguments: - '@Chill\MainBundle\Export\ExportManager' + Chill\MainBundle\Form\Type\DataTransformer\CenterTransformer: + autowire: true + autoconfigure: true + chill.main.form.advanced_search_type: class: Chill\MainBundle\Form\AdvancedSearchType + autowire: true + autoconfigure: true arguments: - "@chill_main.search_provider" tags: @@ -105,6 +116,10 @@ services: tags: - { name: form.type } + Chill\MainBundle\Form\UserType: + autowire: true + autoconfigure: true + Chill\MainBundle\Form\PermissionsGroupType: tags: - { name: form.type } @@ -115,3 +130,16 @@ services: - "@security.token_storage" tags: - { name: form.type } + + + Chill\MainBundle\Form\Type\PickAddressType: + autoconfigure: true + autowire: true + + Chill\MainBundle\Form\DataTransform\AddressToIdDataTransformer: + autoconfigure: true + autowire: true + + Chill\MainBundle\Form\Type\LocationFormType: + autowire: true + autoconfigure: true \ No newline at end of file diff --git a/src/Bundle/ChillMainBundle/config/services/logger.yaml b/src/Bundle/ChillMainBundle/config/services/logger.yaml index a8c8dce58..2da5a4a4c 100644 --- a/src/Bundle/ChillMainBundle/config/services/logger.yaml +++ b/src/Bundle/ChillMainBundle/config/services/logger.yaml @@ -1,8 +1,4 @@ services: - _defaults: - autowire: true - autoconfigure: true - chill.main.logger: # a logger to log events from the app (deletion, remove, etc.) alias: monolog.logger.chill diff --git a/src/Bundle/ChillMainBundle/config/services/menu.yaml b/src/Bundle/ChillMainBundle/config/services/menu.yaml index a41e90345..cf31dccf1 100644 --- a/src/Bundle/ChillMainBundle/config/services/menu.yaml +++ b/src/Bundle/ChillMainBundle/config/services/menu.yaml @@ -1,10 +1,8 @@ services: - _defaults: - autowire: true - autoconfigure: true - Chill\MainBundle\Routing\MenuBuilder\: resource: '../../Routing/MenuBuilder' + autowire: true + autoconfigure: true Chill\MainBundle\Routing\MenuBuilder\UserMenuBuilder: arguments: diff --git a/src/Bundle/ChillMainBundle/config/services/notification.yaml b/src/Bundle/ChillMainBundle/config/services/notification.yaml index 93aa9b770..c8d970c5d 100644 --- a/src/Bundle/ChillMainBundle/config/services/notification.yaml +++ b/src/Bundle/ChillMainBundle/config/services/notification.yaml @@ -1,8 +1,4 @@ services: - _defaults: - autowire: true - autoconfigure: true - Chill\MainBundle\Notification\Mailer: arguments: $logger: '@Psr\Log\LoggerInterface' @@ -12,3 +8,7 @@ services: $router: '@Symfony\Component\Routing\RouterInterface' $translator: '@Symfony\Component\Translation\TranslatorInterface' $routeParameters: '%chill_main.notifications%' + + Chill\MainBundle\Notification\NotificationRenderer: + autoconfigure: true + autowire: true diff --git a/src/Bundle/ChillMainBundle/config/services/pagination.yaml b/src/Bundle/ChillMainBundle/config/services/pagination.yaml index f94bc31be..cb0855a3d 100644 --- a/src/Bundle/ChillMainBundle/config/services/pagination.yaml +++ b/src/Bundle/ChillMainBundle/config/services/pagination.yaml @@ -1,11 +1,9 @@ services: - _defaults: - autowire: true - autoconfigure: true - chill_main.paginator_factory: class: Chill\MainBundle\Pagination\PaginatorFactory public: true + autowire: true + autoconfigure: true arguments: - "@request_stack" - "@router" diff --git a/src/Bundle/ChillMainBundle/config/services/phonenumber.yaml b/src/Bundle/ChillMainBundle/config/services/phonenumber.yaml index 7c5d78e08..f297c03e0 100644 --- a/src/Bundle/ChillMainBundle/config/services/phonenumber.yaml +++ b/src/Bundle/ChillMainBundle/config/services/phonenumber.yaml @@ -1,20 +1,16 @@ services: - _defaults: - autowire: true - autoconfigure: true - Chill\MainBundle\Phonenumber\PhonenumberHelper: arguments: $logger: '@Psr\Log\LoggerInterface' $config: '%chill_main.phone_helper%' $cachePool: '@cache.user_data' - + Chill\MainBundle\Phonenumber\Templating: arguments: $phonenumberHelper: '@Chill\MainBundle\Phonenumber\PhonenumberHelper' tags: - { name: twig.extension } - + Chill\MainBundle\Validation\Validator\ValidPhonenumber: arguments: $logger: '@Psr\Log\LoggerInterface' diff --git a/src/Bundle/ChillMainBundle/config/services/redis.yaml b/src/Bundle/ChillMainBundle/config/services/redis.yaml index 6ccbfee7f..c8d5c2879 100644 --- a/src/Bundle/ChillMainBundle/config/services/redis.yaml +++ b/src/Bundle/ChillMainBundle/config/services/redis.yaml @@ -1,13 +1,10 @@ services: - _defaults: - autowire: true - autoconfigure: true - Chill\MainBundle\Redis\RedisConnectionFactory: arguments: $parameters: "%chill_main.redis%" tags: - { name: kernel.event_subcriber } - + Chill\MainBundle\Redis\ChillRedis: factory: [ '@Chill\MainBundle\Redis\RedisConnectionFactory', 'create' ] + \ No newline at end of file diff --git a/src/Bundle/ChillMainBundle/config/services/routing.yaml b/src/Bundle/ChillMainBundle/config/services/routing.yaml index fa8a56696..c935f1a4d 100644 --- a/src/Bundle/ChillMainBundle/config/services/routing.yaml +++ b/src/Bundle/ChillMainBundle/config/services/routing.yaml @@ -1,8 +1,4 @@ services: - _defaults: - autowire: true - autoconfigure: true - chill.main.menu_composer: class: Chill\MainBundle\Routing\MenuComposer arguments: @@ -10,7 +6,7 @@ services: - '@Knp\Menu\FactoryInterface' - '@Symfony\Component\Translation\TranslatorInterface' Chill\MainBundle\Routing\MenuComposer: '@chill.main.menu_composer' - + chill.main.routes_loader: class: Chill\MainBundle\Routing\Loader\ChillRoutesLoader arguments: diff --git a/src/Bundle/ChillMainBundle/config/services/search.yaml b/src/Bundle/ChillMainBundle/config/services/search.yaml index c0954fffe..38e421eaf 100644 --- a/src/Bundle/ChillMainBundle/config/services/search.yaml +++ b/src/Bundle/ChillMainBundle/config/services/search.yaml @@ -1,12 +1,14 @@ services: - _defaults: - autowire: true - autoconfigure: true - chill_main.search_provider: class: Chill\MainBundle\Search\SearchProvider Chill\MainBundle\Search\SearchProvider: '@chill_main.search_provider' + Chill\MainBundle\Search\SearchApi: + autowire: true + autoconfigure: true + Chill\MainBundle\Search\Entity\: + autowire: true + autoconfigure: true resource: '../../Search/Entity' diff --git a/src/Bundle/ChillMainBundle/config/services/security.yaml b/src/Bundle/ChillMainBundle/config/services/security.yaml index 15e190a1e..dc7949556 100644 --- a/src/Bundle/ChillMainBundle/config/services/security.yaml +++ b/src/Bundle/ChillMainBundle/config/services/security.yaml @@ -12,13 +12,38 @@ services: arguments: - !tagged_iterator chill_main.scope_resolver + # do not autowire the directory Security/Resolver + Chill\MainBundle\Security\Resolver\DefaultCenterResolver: + autoconfigure: true + autowire: true + + Chill\MainBundle\Security\Resolver\DefaultScopeResolver: + autoconfigure: true + autowire: true + + # do not autowire the directory Security/Resolver + Chill\MainBundle\Security\Resolver\ResolverTwigExtension: + autoconfigure: true + autowire: true + + # do not autowire the directory Security/Resolver + Chill\MainBundle\Security\Authorization\DefaultVoterHelperFactory: + autowire: true + + # do not autowire the directory Security/Resolver Chill\MainBundle\Security\Authorization\VoterHelperFactoryInterface: '@Chill\MainBundle\Security\Authorization\DefaultVoterHelperFactory' chill.main.security.authorization.helper: class: Chill\MainBundle\Security\Authorization\AuthorizationHelper + autowire: true + autoconfigure: true Chill\MainBundle\Security\Authorization\AuthorizationHelper: '@chill.main.security.authorization.helper' Chill\MainBundle\Security\Authorization\AuthorizationHelperInterface: '@chill.main.security.authorization.helper' + Chill\MainBundle\Security\ParentRoleHelper: + autowire: true + autoconfigure: true + chill.main.role_provider: class: Chill\MainBundle\Security\RoleProvider Chill\MainBundle\Security\RoleProvider: '@chill.main.role_provider' diff --git a/src/Bundle/ChillMainBundle/config/services/serializer.yaml b/src/Bundle/ChillMainBundle/config/services/serializer.yaml index 4d8aa9954..efe98996e 100644 --- a/src/Bundle/ChillMainBundle/config/services/serializer.yaml +++ b/src/Bundle/ChillMainBundle/config/services/serializer.yaml @@ -1,13 +1,11 @@ --- services: - _defaults: - autowire: true - autoconfigure: true # note: the autowiring for serializers and normalizers is declared # into ../services.yaml Chill\MainBundle\Serializer\Normalizer\DoctrineExistingEntityNormalizer: + autowire: true tags: - { name: 'serializer.normalizer', priority: 8 } diff --git a/src/Bundle/ChillMainBundle/config/services/templating.yaml b/src/Bundle/ChillMainBundle/config/services/templating.yaml index 060b25588..02d806db4 100644 --- a/src/Bundle/ChillMainBundle/config/services/templating.yaml +++ b/src/Bundle/ChillMainBundle/config/services/templating.yaml @@ -1,8 +1,4 @@ services: - _defaults: - autowire: true - autoconfigure: true - # twig_intl: # class: Twig_Extensions_Extension_Intl # tags: @@ -36,6 +32,8 @@ services: - { name: twig.extension } Chill\MainBundle\Templating\Entity\CommentRender: + autoconfigure: true + autowire: true tags: - { name: 'chill.render_entity' } @@ -43,7 +41,17 @@ services: tags: - { name: twig.extension } + Chill\MainBundle\Templating\Entity\AddressRender: + autoconfigure: true + autowire: true + + Chill\MainBundle\Templating\Entity\UserRender: + autoconfigure: true + autowire: true + Chill\MainBundle\Templating\Listing\: resource: './../../Templating/Listing' + autoconfigure: true + autowire: true Chill\MainBundle\Templating\Listing\FilterOrderHelperFactoryInterface: '@Chill\MainBundle\Templating\Listing\FilterOrderHelperFactory' diff --git a/src/Bundle/ChillMainBundle/config/services/timeline.yaml b/src/Bundle/ChillMainBundle/config/services/timeline.yaml index 7b7987f5a..fe830c7ab 100644 --- a/src/Bundle/ChillMainBundle/config/services/timeline.yaml +++ b/src/Bundle/ChillMainBundle/config/services/timeline.yaml @@ -1,8 +1,4 @@ services: - _defaults: - autowire: true - autoconfigure: true - chill_main.timeline_builder: class: Chill\MainBundle\Timeline\TimelineBuilder arguments: diff --git a/src/Bundle/ChillMainBundle/config/services/validator.yaml b/src/Bundle/ChillMainBundle/config/services/validator.yaml index b3b60b9d6..c15b2181e 100644 --- a/src/Bundle/ChillMainBundle/config/services/validator.yaml +++ b/src/Bundle/ChillMainBundle/config/services/validator.yaml @@ -1,15 +1,11 @@ services: - _defaults: - autowire: true - autoconfigure: true - chill_main.validator_user_circle_consistency: class: Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistencyValidator arguments: - "@chill.main.security.authorization.helper" tags: - { name: "validator.constraint_validator" } - + Chill\MainBundle\Validation\Validator\UserUniqueEmailAndUsername: arguments: $em: '@Doctrine\ORM\EntityManagerInterface' diff --git a/src/Bundle/ChillMainBundle/config/services/widget.yaml b/src/Bundle/ChillMainBundle/config/services/widget.yaml index 1f4bca2e3..53f29da5b 100644 --- a/src/Bundle/ChillMainBundle/config/services/widget.yaml +++ b/src/Bundle/ChillMainBundle/config/services/widget.yaml @@ -1,6 +1,2 @@ services: - _defaults: - autowire: true - autoconfigure: true - Chill\MainBundle\Templating\UI\CountNotificationUser: ~