|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace PhpGitHooks\Module\Configuration\Tests\Stub; |
|
4
|
|
|
|
|
5
|
|
|
use PhpGitHooks\Module\Configuration\Contract\Response\PhpCsFixerResponse; |
|
6
|
|
|
use PhpGitHooks\Module\Configuration\Contract\Response\PhpCsResponse; |
|
7
|
|
|
use PhpGitHooks\Module\Configuration\Contract\Response\PhpMdResponse; |
|
8
|
|
|
use PhpGitHooks\Module\Configuration\Contract\Response\PhpUnitGuardCoverageResponse; |
|
9
|
|
|
use PhpGitHooks\Module\Configuration\Contract\Response\PhpUnitResponse; |
|
10
|
|
|
use PhpGitHooks\Module\Configuration\Contract\Response\PhpUnitStrictCoverageResponse; |
|
11
|
|
|
use PhpGitHooks\Module\Configuration\Contract\Response\PreCommitResponse; |
|
12
|
|
|
|
|
13
|
|
|
class PreCommitResponseStub |
|
14
|
|
|
{ |
|
15
|
|
|
const PHPCS_STANDARD = 'PSR2'; |
|
16
|
|
|
const FIX_YOUR_CODE = 'Fix your code'; |
|
17
|
|
|
const GOOD_JOB = 'Good job'; |
|
18
|
|
|
const MINIMUM_COVERAGE = 100.00; |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* @param bool $preCommit |
|
22
|
|
|
* @param string $rightMessage |
|
23
|
|
|
* @param string $errorMessage |
|
24
|
|
|
* @param bool $composer |
|
25
|
|
|
* @param bool $jsonLint |
|
26
|
|
|
* @param bool $phpLint |
|
27
|
|
|
* @param PhpMdResponse $pmdResponse |
|
28
|
|
|
* @param PhpCsResponse $phpCsResponse |
|
29
|
|
|
* @param PhpCsFixerResponse $phpCsFixerResponse |
|
30
|
|
|
* @param PhpUnitResponse $phpUnitResponse |
|
31
|
|
|
* @param PhpUnitStrictCoverageResponse $phpUnitStrictCoverageResponse |
|
32
|
|
|
* @param PhpUnitGuardCoverageResponse $phpUnitGuardCoverageResponse |
|
33
|
|
|
* |
|
34
|
|
|
* @return PreCommitResponse |
|
35
|
|
|
*/ |
|
36
|
|
|
public static function create( |
|
37
|
|
|
$preCommit, |
|
38
|
|
|
$rightMessage, |
|
39
|
|
|
$errorMessage, |
|
40
|
|
|
$composer, |
|
41
|
|
|
$jsonLint, |
|
42
|
|
|
$phpLint, |
|
43
|
|
|
PhpMdResponse $pmdResponse, |
|
44
|
|
|
PhpCsResponse $phpCsResponse, |
|
45
|
|
|
PhpCsFixerResponse $phpCsFixerResponse, |
|
46
|
|
|
PhpUnitResponse $phpUnitResponse, |
|
47
|
|
|
PhpUnitStrictCoverageResponse $phpUnitStrictCoverageResponse, |
|
48
|
|
|
PhpUnitGuardCoverageResponse $phpUnitGuardCoverageResponse |
|
49
|
|
|
) { |
|
50
|
|
|
return new PreCommitResponse( |
|
51
|
|
|
$preCommit, |
|
52
|
|
|
$rightMessage, |
|
53
|
|
|
$errorMessage, |
|
54
|
|
|
$composer, |
|
55
|
|
|
$jsonLint, |
|
56
|
|
|
$phpLint, |
|
57
|
|
|
$pmdResponse, |
|
58
|
|
|
$phpCsResponse, |
|
59
|
|
|
$phpCsFixerResponse, |
|
60
|
|
|
$phpUnitResponse, |
|
61
|
|
|
$phpUnitStrictCoverageResponse, |
|
62
|
|
|
$phpUnitGuardCoverageResponse |
|
63
|
|
|
); |
|
64
|
|
|
} |
|
65
|
|
|
|
|
66
|
|
|
/** |
|
67
|
|
|
* @return PreCommitResponse |
|
68
|
|
|
*/ |
|
69
|
|
|
public static function createAllEnabled() |
|
70
|
|
|
{ |
|
71
|
|
|
$bool = true; |
|
72
|
|
|
|
|
73
|
|
|
return self::create( |
|
74
|
|
|
$bool, |
|
75
|
|
|
static::GOOD_JOB, |
|
76
|
|
|
static::FIX_YOUR_CODE, |
|
77
|
|
|
$bool, |
|
78
|
|
|
$bool, |
|
79
|
|
|
$bool, |
|
80
|
|
|
PhpMdResponseStub::createEnabled(), |
|
81
|
|
|
PhpCsResponseStub::createEnabled(), |
|
82
|
|
|
PhpCsFixerResponseStub::createEnabled(), |
|
83
|
|
|
PhpUnitResponseStub::createEnabled(), |
|
84
|
|
|
PhpUnitStrictCoverageResponseStub::createEnabled(), |
|
85
|
|
|
PhpUnitGuardCoverageResponseStub::createEnabled() |
|
86
|
|
|
); |
|
87
|
|
|
} |
|
88
|
|
|
} |
|
89
|
|
|
|