RedirectCallbackFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 13 1
A createService() 0 4 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