EventManagerFactory.php 694 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php

namespace UnicaenAuth\Event;

use Interop\Container\ContainerInterface;

/**
 * Description of EventManagerFactory
 *
 * @author LECLUSE Laurent <laurent.lecluse at unicaen.fr>
 */
class EventManagerFactory
{

    /**
     * @param ContainerInterface $container
     * @param string             $requestedName
     * @param array|null         $options
     *
     * @return EventManager
     */
    public function __invoke(ContainerInterface $container, $requestedName, $options = null)
    {
        $shared = $container->has('SharedEventManager') ? $container->get('SharedEventManager') : null;
        $eventManager = new EventManager($shared);

        return $eventManager;
    }
}