ApplicationFactory::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 8
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Fabiang\AsseticBundle\Cli;
6
7
use Laminas\ServiceManager\Factory\FactoryInterface;
8
use Psr\Container\ContainerInterface;
9
use Symfony\Component\Console\Application;
10
11
class ApplicationFactory implements FactoryInterface
12
{
13
    /**
14
     * @param string $requestedName
15
     * @return Application
16
     */
17
    public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null)
18
    {
19
        $cliApplication = new Application('AsseticBundle', '3.x');
20
21
        $cliApplication->add(new BuildCommand($container->get('AsseticService')));
22
        $cliApplication->add(new SetupCommand($container->get('AsseticService')));
23
24
        return $cliApplication;
25
    }
26
}
27