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

PrePushResponseStub::createAllEnabled()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 1
eloc 7
nc 1
nop 0
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