Test Failed
Branch issue/#3 (7deea8)
by Koldo
05:23
created

MakeMiddlewareCommandFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 10
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Antidot\DevTools\Container;
6
7
use Antidot\DevTools\Application\Command\MakeMiddleware;
8
use Antidot\DevTools\Application\Service\CreateClassFile;
9
use Antidot\DevTools\Application\Service\GetClassNameFromFQCN;
10
use Antidot\DevTools\Application\Service\GetNamespaceFromFQCN;
11
use Antidot\DevTools\Application\Service\GetRealPathFromNamespace;
12
use Psr\Container\ContainerInterface;
13
14
class MakeMiddlewareCommandFactory
15
{
16
    public function __invoke(ContainerInterface $container): MakeMiddleware
17
    {
18
        return new MakeMiddleware(
19
            $container->get(GetClassNameFromFQCN::class),
20
            $container->get(GetNamespaceFromFQCN::class),
21
            $container->get(GetRealPathFromNamespace::class),
22
            $container->get(CreateClassFile::class),
23
            (array)$container->get('config')
24
        );
25
    }
26
}
27