IndexFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Category\Factory\Controller;
6
7
use Category\Controller\IndexController;
8
use Category\Service\CategoryService;
9
use Interop\Container\ContainerInterface;
10
use Zend\Expressive\Router\RouterInterface;
11
use Zend\Expressive\Template\TemplateRendererInterface;
12
13
/**
14
 * Class CategoryFactory.
15
 */
16
final class IndexFactory
17
{
18
    /**
19
     * Factory method for IndexFactory.
20
     *
21
     * @param ContainerInterface $container container
22
     *
23
     * @return IndexController
24
     */
25
    public function __invoke(ContainerInterface $container) : IndexController
26
    {
27
        return new IndexController(
28
            $container->get(TemplateRendererInterface::class),
29
            $container->get(RouterInterface::class),
30
            $container->get(CategoryService::class)
31
        );
32
    }
33
}
34