Completed
Push — master ( 236db5...b6d10e )
by Pablo
7s
created

PhpUnitGuardCoverageFactory::setUndefined()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
ccs 6
cts 6
cp 1
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
crap 1
1
<?php
2
3
namespace PhpGitHooks\Module\Configuration\Service;
4
5
use PhpGitHooks\Module\Configuration\Domain\Enabled;
6
use PhpGitHooks\Module\Configuration\Domain\Message;
7
use PhpGitHooks\Module\Configuration\Domain\PhpUnitGuardCoverage;
8
use PhpGitHooks\Module\Configuration\Domain\Undefined;
9
10
class PhpUnitGuardCoverageFactory
11
{
12
    /**
13
     * @param array $data
14
     *
15
     * @return PhpUnitGuardCoverage
16
     */
17 1
    public static function build(array $data)
18
    {
19 1
        return new PhpUnitGuardCoverage(
20 1
            new Undefined(false),
21 1
            new Enabled($data['enabled']),
22 1
            new Message($data['message'])
23 1
        );
24
    }
25
26
    /**
27
     * @return PhpUnitGuardCoverage
28
     */
29 3
    public static function setUndefined()
30
    {
31 3
        return new PhpUnitGuardCoverage(
32 3
            new Undefined(true),
33 3
            new Enabled(false),
34 3
            new Message(null)
35 3
        );
36
    }
37
}
38