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