Completed
Branch module_structure (3116d9)
by Pablo
02:56
created

PrePushExecuteFactory   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 28
rs 10
ccs 6
cts 6
cp 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A fromArray() 0 8 2
A setUndefined() 0 8 1
1
<?php
2
3
namespace PhpGitHooks\Module\Configuration\Service;
4
5
use PhpGitHooks\Module\Configuration\Domain\Execute;
6
7
class PrePushExecuteFactory
8
{
9
    /**
10
     * @param array $data
11
     *
12
     * @return Execute
13
     */
14 1
    public static function fromArray(array $data)
15
    {
16
        $tools = [
17 1
            isset($data['phpunit']) ? PhpUnitFactory::fromArray($data['phpunit']) : PhpUnitFactory::setUndefined(),
18
        ];
19
20 1
        return new Execute($tools);
21
    }
22
23
    /**
24
     * @return Execute
25
     */
26 1
    public static function setUndefined()
27
    {
28 1
        return new Execute(
29
            [
30 1
                PhpUnitFactory::setUndefined(),
31
            ]
32
        );
33
    }
34
}
35