services:
    _defaults:
        autowire: true
        autoconfigure: true
        public: false
        bind:
            $extension: '@Zikula\UsersModule\ZikulaUsersModule'
            $installed: '%env(ZIKULA_INSTALLED)%'
            $isUpgrading: "@=container.hasParameter('upgrading') ? parameter('upgrading') : false"

    Zikula\UsersModule\:
        resource: '../../*'
        exclude: '../../{bootstrap.php,Tests,vendor}'

    Zikula\UsersModule\Helper\:
        resource: '../../Helper/*'
        lazy: true

    Zikula\UsersModule\Api\ApiInterface\CurrentUserApiInterface: '@Zikula\UsersModule\Api\CurrentUserApi'
    Zikula\UsersModule\Entity\RepositoryInterface\UserAttributeRepositoryInterface: '@Zikula\UsersModule\Entity\Repository\UserAttributeRepository'
    Zikula\UsersModule\Entity\RepositoryInterface\UserRepositoryInterface: '@Zikula\UsersModule\Entity\Repository\UserRepository'
    Zikula\UsersModule\Entity\RepositoryInterface\UserSessionRepositoryInterface: '@Zikula\UsersModule\Entity\Repository\UserSessionRepository'

    # public because this is often required as part of Doctrine listeners
    # which need to access this using container because CurrentUserApi
    # depends on entities as well
    Zikula\UsersModule\Api\CurrentUserApi:
        public: true

    Zikula\UsersModule\Collector\AuthenticationMethodCollector:
        arguments:
          $methods: !tagged_iterator zikula.authentication_method

    Zikula\UsersModule\Collector\MessageModuleCollector:
        arguments:
          $modules: !tagged_iterator zikula.message_module

    Zikula\UsersModule\Collector\ProfileModuleCollector:
        arguments:
          $modules: !tagged_iterator zikula.profile_module

    Zikula\UsersModule\Listener\UserEventListener:
        arguments:
          $environment: '%env(APP_ENV)%'
