fix: Autowire and autoconfigure services in chill_main.

This commit is contained in:
Pol Dellaiera 2021-11-17 20:31:20 +01:00
parent d830b19756
commit d7fbbbf92c
No known key found for this signature in database
GPG Key ID: D476DFE9C67467CA
23 changed files with 92 additions and 115 deletions

View File

@ -8,28 +8,21 @@ 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' }

View File

@ -1,4 +1,8 @@
services:
_defaults:
autowire: true
autoconfigure: true
chill_main.tag_aware_cache:
class: Symfony\Component\Cache\Adapter\TagAwareAdapter
arguments:

View File

@ -1,11 +1,9 @@
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 }

View File

@ -1,12 +1,13 @@
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']
@ -28,10 +29,6 @@ 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'

View File

@ -1,4 +1,8 @@
services:
_defaults:
autowire: true
autoconfigure: true
Chill\MainBundle\CRUD\Routing\CRUDRoutesLoader:
arguments:
$crudConfig: '%chill_main_crud_route_loader_config%'

View File

@ -1,3 +1,7 @@
---
services:
'Chill\MainBundle\Doctrine\Migrations\VersionComparator': ~
_defaults:
autowire: true
autoconfigure: true
Chill\MainBundle\Doctrine\Migrations\VersionComparator: ~

View File

@ -1,9 +1,13 @@
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
@ -11,7 +15,7 @@ services:
# - "@translator"
# tags:
# - { name: chill.export_formatter, alias: 'csv' }
chill.main.export.spreadsheet_formatter:
class: Chill\MainBundle\Export\Formatter\SpreadSheetFormatter
arguments:
@ -19,7 +23,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:
@ -27,7 +31,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:
@ -35,7 +39,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:
@ -43,4 +47,3 @@ services:
$exportManager: '@Chill\MainBundle\Export\ExportManager'
tags:
- { name: chill.export_formatter, alias: 'csv_pivoted_list' }

View File

@ -1,4 +1,8 @@
services:
_defaults:
autowire: true
autoconfigure: true
Chill\MainBundle\DataFixtures\ORM\:
resource: ../../DataFixtures/ORM
tags: [ 'doctrine.fixture.orm' ]

View File

@ -1,4 +1,7 @@
services:
_defaults:
autowire: true
autoconfigure: true
chill.main.form.type.translatable.string:
class: Chill\MainBundle\Form\Type\TranslatableStringFormType
@ -39,10 +42,6 @@ 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:
@ -62,10 +61,6 @@ 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:
@ -96,14 +91,8 @@ 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:
@ -116,10 +105,6 @@ services:
tags:
- { name: form.type }
Chill\MainBundle\Form\UserType:
autowire: true
autoconfigure: true
Chill\MainBundle\Form\PermissionsGroupType:
tags:
- { name: form.type }
@ -130,16 +115,3 @@ 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

View File

@ -1,4 +1,8 @@
services:
_defaults:
autowire: true
autoconfigure: true
chill.main.logger:
# a logger to log events from the app (deletion, remove, etc.)
alias: monolog.logger.chill

View File

@ -1,9 +1,11 @@
services:
Chill\MainBundle\Routing\MenuBuilder\:
resource: '../../Routing/MenuBuilder'
_defaults:
autowire: true
autoconfigure: true
Chill\MainBundle\Routing\MenuBuilder\:
resource: '../../Routing/MenuBuilder'
Chill\MainBundle\Routing\MenuBuilder\UserMenuBuilder:
arguments:
$tokenStorage: '@Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface'

View File

@ -1,4 +1,8 @@
services:
_defaults:
autowire: true
autoconfigure: true
Chill\MainBundle\Notification\Mailer:
arguments:
$logger: '@Psr\Log\LoggerInterface'
@ -8,7 +12,3 @@ services:
$router: '@Symfony\Component\Routing\RouterInterface'
$translator: '@Symfony\Component\Translation\TranslatorInterface'
$routeParameters: '%chill_main.notifications%'
Chill\MainBundle\Notification\NotificationRenderer:
autoconfigure: true
autowire: true

View File

@ -1,9 +1,11 @@
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"

View File

@ -1,16 +1,20 @@
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'

View File

@ -1,10 +1,13 @@
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' ]

View File

@ -1,4 +1,8 @@
services:
_defaults:
autowire: true
autoconfigure: true
chill.main.menu_composer:
class: Chill\MainBundle\Routing\MenuComposer
arguments:
@ -6,7 +10,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:

View File

@ -1,14 +1,12 @@
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'

View File

@ -12,38 +12,13 @@ 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'

View File

@ -1,11 +1,13 @@
---
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 }

View File

@ -1,4 +1,8 @@
services:
_defaults:
autowire: true
autoconfigure: true
# twig_intl:
# class: Twig_Extensions_Extension_Intl
# tags:
@ -32,8 +36,6 @@ services:
- { name: twig.extension }
Chill\MainBundle\Templating\Entity\CommentRender:
autoconfigure: true
autowire: true
tags:
- { name: 'chill.render_entity' }
@ -41,17 +43,7 @@ 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'

View File

@ -1,4 +1,8 @@
services:
_defaults:
autowire: true
autoconfigure: true
chill_main.timeline_builder:
class: Chill\MainBundle\Timeline\TimelineBuilder
arguments:

View File

@ -1,11 +1,15 @@
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'

View File

@ -1,2 +1,6 @@
services:
_defaults:
autowire: true
autoconfigure: true
Chill\MainBundle\Templating\UI\CountNotificationUser: ~