services:
    terminal42_url_rewrite.rewrite_controller:
        class: Terminal42\UrlRewriteBundle\Controller\RewriteController
        public: true
        arguments:
            - "@terminal42_url_rewrite.provider"
            - "@contao.insert_tag.parser"

    terminal42_url_rewrite.qr_code_controller:
        class: Terminal42\UrlRewriteBundle\Controller\QrCodeController
        public: true
        arguments:
            - "@database_connection"
            - "@terminal42_url_rewrite.qr_code_generator"
            - "@request_stack"
            - "@router"
            - "@uri_signer"

    Terminal42\UrlRewriteBundle\Controller\QrCodeController:
        alias: terminal42_url_rewrite.qr_code_controller
        public: true

    terminal42_url_rewrite.qr_code_generator:
        class: Terminal42\UrlRewriteBundle\QrCodeGenerator
        arguments:
            - "@router"

    terminal42_url_rewrite.rewrite_loader:
        class: Terminal42\UrlRewriteBundle\Routing\UrlRewriteLoader
        arguments:
            - "@terminal42_url_rewrite.provider"
        tags:
            - { name: routing.loader }

    terminal42_url_rewrite.provider:
        alias: terminal42_url_rewrite.provider.chain

    terminal42_url_rewrite.provider.bundle:
        class: Terminal42\UrlRewriteBundle\ConfigProvider\BundleConfigProvider
        public: false
        tags:
            - { name: terminal42_url_rewrite.provider, priority: 64 }

    terminal42_url_rewrite.provider.chain:
        class: Terminal42\UrlRewriteBundle\ConfigProvider\ChainConfigProvider
        public: false

    terminal42_url_rewrite.provider.database:
        class: Terminal42\UrlRewriteBundle\ConfigProvider\DatabaseConfigProvider
        public: false
        arguments:
            - "@database_connection"
        tags:
            - { name: terminal42_url_rewrite.provider, priority: 32 }
