services:
    notimeo.user_checker:
        class: Notimeo\UserBundle\Security\UserChecker
        arguments:
            - '@translator.default'

    notimeo.user_hash_generate:
        class: Notimeo\UserBundle\Services\UserHashServices
        arguments:
            - "@router"

    notimeo.user.routing:
        class: Notimeo\UserBundle\Routing\NotimeoUserLoader
        tags:
            - { name: routing.loader }

    notimeo.user.points_subscriber:
        class: Notimeo\UserBundle\EventListener\PointsSubscriber
        tags:
            - { name: doctrine.event_subscriber, connection: default }

    notimeo.user.slug_subscriber:
        class: Notimeo\UserBundle\EventListener\UserSlugSubscriber
        tags:
            - { name: doctrine.event_subscriber, connection: default }

    security.authentication.success_handler:
        class: Notimeo\UserBundle\Handler\AuthenticationSuccessHandler
        arguments:
            - "@security.http_utils"
            - {}
            - '@doctrine.orm.entity_manager'
        tags:
            - { name: 'monolog.logger', channel: 'security' }

    security.authentication.failure_handler:
        class:  Notimeo\UserBundle\Handler\AuthenticationFailureHandler
        arguments:
            - "@http_kernel"
            - "@security.http_utils"
            - {}
            - "@logger"
            - '@doctrine.orm.entity_manager'
        tags:
            - { name: 'monolog.logger', channel: 'security' }
    notimeo.validator.contains_host:
        class: Notimeo\UserBundle\Validator\Constraints\AcceptedRegValidator
        tags:
            -  name: validator.constraint_validator

    notimeo.validator.current_user_password:
        class: Notimeo\UserBundle\Validator\Constraints\CurrentUserPasswordValidator
        arguments:
            - '@security.token_storage'
            - '@security.password_encoder'
        tags:
            -  name: validator.constraint_validator

    Notimeo\UserBundle\Validator\Constraints\ChangeMyEmailValidator:
        class: Notimeo\UserBundle\Validator\Constraints\ChangeMyEmailValidator
        arguments:
            - '@doctrine.orm.entity_manager'
            - '@security.token_storage'
        tags:
            -  name: validator.constraint_validator

    notimeo.user.listener.breadcrumbs:
        class: Notimeo\UserBundle\EventListener\UserBreadcrumbListener
        tags:
            - { name: kernel.event_listener, event: notimeo.breadcrumbs }
        arguments:
            - '@app.breadcrumbs_services'
            - '@translator.default'

    notimeo.user.user_type:
        class: Notimeo\UserBundle\Form\Type\UsersType
        arguments:
            - '@doctrine.orm.entity_manager'
        tags:
            - { name: form.type }