ConsoleBusinessFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 0
f 0
dl 0
loc 18
ccs 6
cts 6
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createApplication() 0 5 1
A getCommandCollection() 0 3 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