PhpUnitFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 5
dl 0
loc 30
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A fromArray() 0 9 1
A setUndefined() 0 9 1
1
<?php
2
3
namespace PhpGitHooks\Module\Configuration\Service;
4
5
use PhpGitHooks\Module\Configuration\Domain\Enabled;
6
use PhpGitHooks\Module\Configuration\Domain\PhpUnit;
7
use PhpGitHooks\Module\Configuration\Domain\PhpUnitOptions;
8
use PhpGitHooks\Module\Configuration\Domain\PhpUnitRandomMode;
9
use PhpGitHooks\Module\Configuration\Domain\Undefined;
10
11
class PhpUnitFactory
12
{
13
    /**
14
     * @param array $data
15
     *
16
     * @return PhpUnit
17
     */
18 1
    public static function fromArray(array $data)
19
    {
20 1
        return new PhpUnit(
21 1
            new Undefined(false),
22 1
            new Enabled($data['enabled']),
23 1
            new PhpUnitRandomMode($data['random-mode']),
24 1
            new PhpUnitOptions($data['options'])
25
        );
26
    }
27
28
    /**
29
     * @return PhpUnit
30
     */
31 3
    public static function setUndefined()
32
    {
33 3
        return new PhpUnit(
34 3
            new Undefined(true),
35 3
            new Enabled(false),
36 3
            new PhpUnitRandomMode(false),
37 3
            new PhpUnitOptions(null)
38
        );
39
    }
40
}
41