IndexFactory::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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