PrePushResponseStub   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 4
dl 0
loc 48
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 17 1
A createAllEnabled() 0 11 1
1
<?php
2
3
namespace PhpGitHooks\Module\Configuration\Tests\Stub;
4
5
use PhpGitHooks\Module\Configuration\Contract\Response\PhpUnitGuardCoverageResponse;
6
use PhpGitHooks\Module\Configuration\Contract\Response\PhpUnitResponse;
7
use PhpGitHooks\Module\Configuration\Contract\Response\PhpUnitStrictCoverageResponse;
8
use PhpGitHooks\Module\Configuration\Contract\Response\PrePushResponse;
9
10
class PrePushResponseStub
11
{
12
    const RIGHT_MESSAGE = 'OK';
13
    const ERROR_MESSAGE = 'BAD PUSH';
14
15
    /**
16
     * @param $prePush
17
     * @param $rightMessage
18
     * @param $errorMessage
19
     * @param PhpUnitResponse               $phpUnitResponse
20
     * @param PhpUnitStrictCoverageResponse $phpUnitStrictCoverageResponse
21
     * @param PhpUnitGuardCoverageResponse  $phpUnitGuardCoverageResponse
22
     *
23
     * @return PrePushResponse
24
     */
25
    public static function create(
26
        $prePush,
27
        $rightMessage,
28
        $errorMessage,
29
        PhpUnitResponse $phpUnitResponse,
30
        PhpUnitStrictCoverageResponse $phpUnitStrictCoverageResponse,
31
        PhpUnitGuardCoverageResponse $phpUnitGuardCoverageResponse
32
    ) {
33
        return new PrePushResponse(
34
            $prePush,
35
            $rightMessage,
36
            $errorMessage,
37
            $phpUnitResponse,
38
            $phpUnitStrictCoverageResponse,
39
            $phpUnitGuardCoverageResponse
40
        );
41
    }
42
43
    /**
44
     * @return PrePushResponse
45
     */
46
    public static function createAllEnabled()
47
    {
48
        return new PrePushResponse(
49
            true,
50
            self::RIGHT_MESSAGE,
51
            self::ERROR_MESSAGE,
52
            PhpUnitResponseStub::createEnabled(),
53
            PhpUnitStrictCoverageResponseStub::createEnabled(),
54
            PhpUnitGuardCoverageResponseStub::createEnabled()
55
        );
56
    }
57
}
58