ConsoleBusinessFactory::createApplication()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
4
namespace Xervice\Console\Business;
5
6
7
use Xervice\Console\Business\Model\Application\Application;
8
use Xervice\Console\Business\Model\Command\CommandCollection;
9
use Xervice\Console\ConsoleDependencyProvider;
10
use Xervice\Core\Business\Model\Factory\AbstractBusinessFactory;
11
12
class ConsoleBusinessFactory extends AbstractBusinessFactory
13
{
14
    /**
15
     * @return \Xervice\Console\Business\Model\Application\Application
16
     */
17 1
    public function createApplication(): Application
18
    {
19 1
        $app = new Application();
20 1
        $app->addCommandCollection($this->getCommandCollection());
21 1
        return $app;
22
    }
23
24
    /**
25
     * @return \Xervice\Console\Business\Model\Command\CommandCollection
26
     */
27 1
    public function getCommandCollection(): CommandCollection
28
    {
29 1
        return $this->getDependency(ConsoleDependencyProvider::COMMAND_COLLECTION);
30
    }
31
}
32