services:
  _defaults:
    public: false

  netzmacht.contao_toolkit.assets_manager:
    class: Netzmacht\Contao\Toolkit\View\Assets\GlobalsAssetsManager
    factory: ['@netzmacht.contao_toolkit.globals_assets_manager_factory', 'create']

  netzmacht.contao_toolkit.callback_invoker:
    class: Netzmacht\Contao\Toolkit\Callback\Invoker
    arguments:
      - '@netzmacht.contao_toolkit.contao.system_adapter'

  netzmacht.contao_toolkit.component.content_element_factory:
    class: Netzmacht\Contao\Toolkit\Component\ToolkitComponentFactory
    public: true
    arguments:
      - []

  netzmacht.contao_toolkit.component.frontend_module_factory:
    class: Netzmacht\Contao\Toolkit\Component\ToolkitComponentFactory
    public: true
    arguments:
      - []

  netzmacht.contao_toolkit.contao_services_factory:
    class: Netzmacht\Contao\Toolkit\Bundle\DependencyInjection\ContaoServicesFactory
    arguments:
      - '@contao.framework'

  netzmacht.contao_toolkit.contao.backend_adapter:
    class: Contao\CoreBundle\Framework\Adapter
    factory: ['@netzmacht.contao_toolkit.contao_services_factory', 'createBackendAdapter']

  netzmacht.contao_toolkit.contao.config_adapter:
    class: Contao\CoreBundle\Framework\Adapter
    factory: ['@netzmacht.contao_toolkit.contao_services_factory', 'createConfigAdapter']

  netzmacht.contao_toolkit.contao.encryption_adapter:
    class: Contao\CoreBundle\Framework\Adapter
    factory: ['@netzmacht.contao_toolkit.contao_services_factory', 'createEncryptionAdapter']

  netzmacht.contao_toolkit.contao.environment_adapter:
    class: Contao\CoreBundle\Framework\Adapter
    factory: ['@netzmacht.contao_toolkit.contao_services_factory', 'createEnvironmentAdapter']

  netzmacht.contao_toolkit.contao.input_adapter:
    class: Contao\CoreBundle\Framework\Adapter
    factory: ['@netzmacht.contao_toolkit.contao_services_factory', 'createInputAdapter']

  netzmacht.contao_toolkit.contao.model_adapter:
      class: Contao\CoreBundle\Framework\Adapter
      factory: ['@netzmacht.contao_toolkit.contao_services_factory', 'createModelAdapter']

  netzmacht.contao_toolkit.contao.system_adapter:
    class: Contao\CoreBundle\Framework\Adapter
    factory: ['@netzmacht.contao_toolkit.contao_services_factory', 'createSystemAdapter']

  netzmacht.contao_toolkit.contao.controller_adapter:
    class: Contao\CoreBundle\Framework\Adapter
    factory: ['@netzmacht.contao_toolkit.contao_services_factory', 'createControllerAdapter']

  netzmacht.contao_toolkit.contao.message_adapter:
    class: Contao\CoreBundle\Framework\Adapter
    factory: ['@netzmacht.contao_toolkit.contao_services_factory', 'createMessageAdapter']

  netzmacht.contao_toolkit.contao.backend_user:
    class: Contao\BackendUser
    factory: ['@netzmacht.contao_toolkit.contao_services_factory', 'createBackendUserInstance']

  netzmacht.contao_toolkit.contao.frontend_user:
    class: Contao\FrontendUser
    factory: ['@netzmacht.contao_toolkit.contao_services_factory', 'createFrontendUserInstance']

  netzmacht.contao_toolkit.data.alias_generator.factory.default_factory:
    class: Netzmacht\Contao\Toolkit\Data\Alias\Factory\ToolkitAliasGeneratorFactory
    public: true
    arguments:
      - '@database_connection'

  netzmacht.contao_toolkit.data.database_row_updater:
    class: Netzmacht\Contao\Toolkit\Data\Updater\DatabaseRowUpdater
    arguments:
      - '@netzmacht.contao_toolkit.contao.backend_user'
      - '@database_connection'
      - '@netzmacht.contao_toolkit.dca.manager'
      - '@netzmacht.contao_toolkit.callback_invoker'

  netzmacht.contao_toolkit.dca.formatter.factory:
    class: Netzmacht\Contao\Toolkit\Dca\Formatter\FormatterFactory
    arguments:
      - '@event_dispatcher'

  netzmacht.contao_toolkit.dca.manager:
    class: Netzmacht\Contao\Toolkit\Dca\Manager
    arguments:
      - '@netzmacht.contao_toolkit.dca.loader'
      - '@netzmacht.contao_toolkit.dca.formatter.factory'

  netzmacht.contao_toolkit.dca.loader:
    class: Netzmacht\Contao\Toolkit\Dca\DcaLoader

  netzmacht.contao_toolkit.view.template_factory:
    class: Netzmacht\Contao\Toolkit\View\Template\ToolkitTemplateFactory
    arguments:
      - "@event_dispatcher"

  netzmacht.contao_toolkit.view.template_name_parser:
    class: Netzmacht\Contao\Toolkit\View\Template\ToolkitTemplateNameParser

  templating.engine.toolkit:
    class: Netzmacht\Contao\Toolkit\View\Template\ToolkitTemplateEngine
    arguments:
      - '@netzmacht.contao_toolkit.view.template_factory'
      - '@netzmacht.contao_toolkit.view.template_name_parser'

  netzmacht.contao_toolkit.globals_assets_manager_factory:
    class: Netzmacht\Contao\Toolkit\View\Assets\GlobalsAssetsManagerFactory
    arguments:
      - '%kernel.debug%'

  netzmacht.contao_toolkit.repository_manager:
    class: Netzmacht\Contao\Toolkit\Data\Model\ToolkitRepositoryManager
    arguments:
      - '@database_connection'
      - []

  netzmacht.contao_toolkit.routing.scope_matcher:
    class: Netzmacht\Contao\Toolkit\Routing\RequestScopeMatcher
    arguments:
      - '@contao.routing.scope_matcher'
      - '@request_stack'

  netzmacht.contao_toolkit.response_tagger:
    class: Netzmacht\Contao\Toolkit\Response\NoOpResponseTagger

  netzmacht.contao_toolkit.logger.null_logger:
    class: Psr\Log\NullLogger
