ControllerServiceFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 4
dl 0
loc 23
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 16 1
1
<?php
2
3
namespace MaglLegacyApplication\Factory;
4
5
use Interop\Container\ContainerInterface;
6
use Laminas\Mvc\MvcEvent;
7
use Laminas\Router\RouteMatch;
8
use Laminas\ServiceManager\Factory\FactoryInterface;
9
use MaglLegacyApplication\Service\ControllerService;
10
11
class ControllerServiceFactory implements FactoryInterface
12
{
13
14
    /**
15
     * @inheritDoc
16
     */
17 1
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
18
    {
19 1
        $eventManager = $container->get('Application')->getEventManager();
20
21 1
        $event = new MvcEvent();
22 1
        $event->setApplication($container->get('Application'));
23 1
        $event->setTarget($container->get('Application'));
24 1
        $event->setRequest($container->get('Request'));
25 1
        $event->setRouter($container->get('Router'));
26
27 1
        $routeMatch = new RouteMatch(array());
28
29 1
        $event->setRouteMatch($routeMatch);
30
31 1
        return new ControllerService($eventManager, $event);
32
    }
33
}
34