Completed
Push — master ( 30874d...ed8031 )
by Pablo
02:56
created

PrePushResponseStub   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 44
rs 10

2 Methods

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