RedirectCallbackFactory::createService()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace LmcUser\Factory\Controller;
4
5
use Interop\Container\ContainerInterface;
6
use Laminas\Mvc\Application;
7
use Laminas\Router\RouteInterface;
8
use Laminas\ServiceManager\Factory\FactoryInterface;
9
use Laminas\ServiceManager\ServiceLocatorInterface;
10
use LmcUser\Controller\RedirectCallback;
11
use LmcUser\Options\ModuleOptions;
12
13
class RedirectCallbackFactory implements FactoryInterface
14
{
15
    public function __invoke(ContainerInterface $serviceLocator, $requestedName, array $options = null)
16
    {
17
        /* @var RouteInterface $router */
18
        $router = $serviceLocator->get('Router');
19
20
        /* @var Application $application */
21
        $application = $serviceLocator->get('Application');
22
23
        /* @var ModuleOptions $options */
24
        $options = $serviceLocator->get('lmcuser_module_options');
25
26
        return new RedirectCallback($application, $router, $options);
27
    }
28
29
    /**
30
     * Create service
31
     *
32
     * @param  ServiceLocatorInterface $serviceLocator
33
     * @return mixed
34
     */
35
    public function createService(ServiceLocatorInterface $serviceLocator)
36
    {
37
        return $this->__invoke($serviceLocator, null);
38
    }
39
}
40