AuthFactory::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 9
Ratio 100 %

Importance

Changes 0
Metric Value
dl 9
loc 9
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Admin\Factory\Controller;
6
7
use Admin\Controller\AuthController;
8
use Admin\Service\AdminUserService;
9
use Interop\Container\ContainerInterface;
10
use Zend\Expressive\Router\RouterInterface;
11
use Zend\Expressive\Template\TemplateRendererInterface;
12
13
/**
14
 * Class AuthFactory.
15
 */
16 View Code Duplication
final class AuthFactory
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
17
{
18
    /**
19
     * Factory method.
20
     *
21
     * @param ContainerInterface $container container
22
     *
23
     * @return AuthController
24
     */
25
    public function __invoke(ContainerInterface $container) : AuthController
26
    {
27
        return new AuthController(
28
            $container->get(RouterInterface::class),
29
            $container->get(TemplateRendererInterface::class),
30
            $container->get('session'),
31
            $container->get(AdminUserService::class)
32
        );
33
    }
34
}
35