# This file contains only services that cannot be defined using annotations.

imports:
    - { resource: services/checker.yml }
    - { resource: services/command.yml }
    - { resource: services/configuration.yml }
    - { resource: services/controller.yml }
    - { resource: services/converter.yml }
    - { resource: services/crud.yml }
    - { resource: services/exporter.yml }
    - { resource: services/finder.yml }
    - { resource: services/importer.yml }
    - { resource: services/listener.yml }
    - { resource: services/library.yml }
    - { resource: services/manager.yml }
    - { resource: services/messenger.yml }
    - { resource: services/repository.yml }
    - { resource: services/serializer.yml }
    - { resource: services/session.yml }
    - { resource: services/subscriber.yml }
    - { resource: services/twig.yml }
    - { resource: services/updater.yml }
    - { resource: services/validator.yml }
    - { resource: services/voter.yml }

services:
    Claroline\CoreBundle\Listener\AuthenticationFailureHandler:
        parent: security.authentication.failure_handler
        calls:
            - method: setDispatcher
              arguments:
                - '@Claroline\AppBundle\Event\StrictDispatcher'
            - method: setObjectManager
              arguments:
                - '@Claroline\AppBundle\Persistence\ObjectManager'

    # array injection with annotations is not supported
    claroline.plugin.validator:
        class: Claroline\CoreBundle\Library\Installation\Plugin\Validator
        arguments:
            - config: '@Claroline\CoreBundle\Library\Installation\Plugin\ConfigurationChecker'

    # vendor classes used as service arguments
    claroline.symfony_yaml:
        class: Symfony\Component\Yaml\Parser
        public: false

    #notification listeners
    claroline.listener.core.notification_listener:
        class: Claroline\CoreBundle\Listener\Notification\NotificationListener
        calls:
            - [setContainer, ["@service_container"]]
        tags:
            - { name: kernel.event_listener, event: create_notification_item_workspace-role-change_right, method: onCreateNotificationItem }
            - { name: kernel.event_listener, event: create_notification_item_workspace-role-subscribe_user, method: onCreateNotificationItem }
            - { name: kernel.event_listener, event: create_notification_item_workspace-role-subscribe_group, method: onCreateNotificationItem }
            - { name: kernel.event_listener, event: create_notification_item_role-subscribe_user, method: onCreateNotificationItem }
            - { name: kernel.event_listener, event: create_notification_item_role-subscribe_group, method: onCreateNotificationItem }
            - { name: kernel.event_listener, event: create_notification_item_resource-create, method: onCreateNotificationItem }
            - { name: kernel.event_listener, event: create_notification_item_resource-publish, method: onCreateNotificationItem }
            - { name: kernel.event_listener, event: create_notification_item_role-subscribe-queue, method: onCreateNotificationItem }
            - { name: kernel.event_listener, event: create_notification_item_resource-text-update, method: onCreateNotificationItem }
