services:
  _instanceof:
    Contao\CoreBundle\Framework\FrameworkAwareInterface:
      calls:
        - ["setFramework", ["@contao.framework"]]
    Symfony\Component\DependencyInjection\ContainerAwareInterface:
      calls:
        - ["setContainer", ["@service_container"]]

  HeimrichHannot\UtilsBundle\Util\Utils:
    public: true
    autowire: true
    autoconfigure: true

  HeimrichHannot\UtilsBundle\Util\:
    resource: '../../Util/*'
    exclude: '../../Util/Utils.php'
    autowire: true
    autoconfigure: true
    bind:
      $kernelPackages: '%kernel.packages%'

  HeimrichHannot\UtilsBundle\Util\Container\ContainerUtil:
    autowire: true
    autoconfigure: true
    bind:
      $kernelBundles: '%kernel.bundles%'
    tags:
      - { name: 'container.service_subscriber', key: 'lexik_maintenance.driver.factory', id: 'lexik_maintenance.driver.factory' }
      - { name: 'container.service_subscriber', key: 'monolog.logger.contao', id: 'monolog.logger.contao' }



  HeimrichHannot\UtilsBundle\EventListener\:
    resource: '../../EventListener/*'
    autowire: true
    public: true
    bind:
      $bundleConfig: '%huh_utils%'

  # util services
  huh.utils.cache.database:
    class: HeimrichHannot\UtilsBundle\Cache\DatabaseCacheUtil
    public: true
    arguments:
      - "@service_container"
  huh.utils.cache.database_tree:
    class: HeimrichHannot\UtilsBundle\Cache\DatabaseTreeCache
    public: true
    autowire: true
  huh.utils.code:
    class: HeimrichHannot\UtilsBundle\Security\CodeUtil
    public: true
    arguments:
      - "@contao.framework"
  huh.utils.encryption:
    class: HeimrichHannot\UtilsBundle\Security\EncryptionUtil
    public: true
    arguments:
      - "@contao.framework"
  huh.utils.database:
    class: HeimrichHannot\UtilsBundle\Database\DatabaseUtil
    public: true
    arguments:
      - "@contao.framework"
  huh.utils.location:
    class: HeimrichHannot\UtilsBundle\Location\LocationUtil
    public: true
    arguments:
      - "@contao.framework"
  huh.utils.request.curl:
    class: HeimrichHannot\UtilsBundle\Request\CurlRequestUtil
    public: true
    arguments:
      - "@contao.framework"
      - "@service_container"
  huh.utils.url:
    class: HeimrichHannot\UtilsBundle\Url\UrlUtil
    public: true
    autowire: true
  huh.utils.routing:
    class: HeimrichHannot\UtilsBundle\Routing\RoutingUtil
    public: true
    arguments:
      - "@router"
      - "@request_stack"
      - "%contao.csrf_token_name%"
  huh.utils.salutation:
    class: HeimrichHannot\UtilsBundle\Salutation\SalutationUtil
    public: true
    arguments:
      - "@contao.framework"
  huh.utils.pdf.writer:
    class: HeimrichHannot\UtilsBundle\Pdf\PdfWriter
    public: true
    lazy:  true
    arguments:
      - "@contao.framework"
    deprecated: "Service %service_id% is deprecated and will be removed in next major verison. Use PDFCreator instead."
  huh.utils.pdf.fpdi_writer:
    class: HeimrichHannot\UtilsBundle\Pdf\FPDIWriter
    public: true
    lazy:  true
    deprecated: "Service %service_id% is deprecated and will be removed in next major verison. Use PDFCreator instead."
  huh.utils.comparison:
    class: HeimrichHannot\UtilsBundle\Comparison\CompareUtil
    public: true
    lazy:  true
    arguments:
      - "@contao.framework"
  huh.twig.extension.date:
    class: HeimrichHannot\UtilsBundle\Twig\DateExtension
    public: true
    tags: [twig.extension]
  huh.twig.extension.download:
    class: HeimrichHannot\UtilsBundle\Twig\DownloadExtension
    public: true
    tags: [twig.extension]
  huh.twig.extension.file:
    class: HeimrichHannot\UtilsBundle\Twig\FileExtension
    public: true
    tags: [twig.extension]
  huh.twig.extension.image:
    class: HeimrichHannot\UtilsBundle\Twig\ImageExtension
    public: true
    tags: [twig.extension]
  huh.twig.extension.test:
    class: HeimrichHannot\UtilsBundle\Twig\TestExtension
    public: true
    tags: [twig.extension]
  huh.twig.extension.array:
    class: HeimrichHannot\UtilsBundle\Twig\ArrayExtension
    public: true
    tags: [twig.extension]
  huh.twig.extension.dca:
    class: HeimrichHannot\UtilsBundle\Twig\DcaExtension
    public: true
    tags: [twig.extension]
  huh.cache.warm_internal:
    class: HeimrichHannot\UtilsBundle\Cache\UtilCacheWarmer
    arguments:
      - "@filesystem"
      - "@contao.resource_finder"
      - "@contao.resource_locator"
      - "%kernel.project_dir%"
      - "@database_connection"
      - "@huh.utils.template"
      - "@contao.framework"
    tags:
      - { name: kernel.cache_warmer }

  # Deprecations:
  # @TODO: remove in next major version

  huh.utils.pdf_writer:
    alias: huh.utils.pdf.writer
    deprecated: "Service %alias_id% is deprecated and will be removed in next major verison. Use PDFCreator instead."
