getConfigurationFactory()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.0625

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 3
cts 4
cp 0.75
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 2.0625
1
<?php
2
3
namespace Magium\Configuration\Console\Command;
4
5
use Magium\Configuration\MagiumConfigurationFactory;
6
use Magium\Configuration\MagiumConfigurationFactoryInterface;
7
8
trait ConfigurationFactoryTrait
9
{
10
11
    protected $factory;
12
13 14
    public function setConfigurationFactory(MagiumConfigurationFactoryInterface $factory)
14
    {
15 14
        $this->factory = $factory;
16 14
    }
17
18 14
    protected function getConfigurationFactory()
19
    {
20 14
        if (!$this->factory instanceof MagiumConfigurationFactoryInterface) {
21
            $this->factory = new MagiumConfigurationFactory();
22
        }
23 14
        return $this->factory;
24
    }
25
}
26