ConfigStub   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 4
dl 0
loc 46
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 4 1
A random() 0 4 1
A createUndefined() 0 8 1
A createEnabled() 0 8 1
1
<?php
2
3
namespace PhpGitHooks\Module\Configuration\Tests\Stub;
4
5
use PhpGitHooks\Module\Configuration\Domain\CommitMsg;
6
use PhpGitHooks\Module\Configuration\Domain\Config;
7
use PhpGitHooks\Module\Configuration\Domain\PreCommit;
8
use PhpGitHooks\Module\Configuration\Domain\PrePush;
9
use PhpGitHooks\Module\Tests\Infrastructure\Stub\RandomStubInterface;
10
11
class ConfigStub implements RandomStubInterface
12
{
13
    /**
14
     * @param PreCommit $preCommit
15
     * @param CommitMsg $commitMsg
16
     * @param PrePush $prePush
17
     *
18
     * @return Config
19
     */
20
    public static function create(PreCommit $preCommit, CommitMsg $commitMsg, PrePush $prePush)
21
    {
22
        return new Config($preCommit, $commitMsg, $prePush);
23
    }
24
25
    /**
26
     * @return Config
27
     */
28
    public static function random()
29
    {
30
        return self::create(PreCommitStub::random(), CommitMsgStub::random(), PrePushStub::random());
31
    }
32
33
    /**
34
     * @return Config
35
     */
36
    public static function createUndefined()
37
    {
38
        return self::create(
39
            PreCommitStub::createUndefined(),
40
            CommitMsgStub::setUndefined(),
41
            PrePushStub::setUndefined()
42
        );
43
    }
44
45
    /**
46
     * @return Config
47
     */
48
    public static function createEnabled()
49
    {
50
        return self::create(
51
            PreCommitStub::createAllEnabled(),
52
            CommitMsgStub::createEnabled(),
53
            PrePushStub::createAllEnabled()
54
        );
55
    }
56
}
57