1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace PhpGitHooks\Module\Configuration\Tests\Stub; |
4
|
|
|
|
5
|
|
|
use PhpGitHooks\Module\Configuration\Service\HookQuestions; |
6
|
|
|
|
7
|
|
|
class ConfigArrayDataStub |
8
|
|
|
{ |
9
|
|
|
const PHPCS_STANDARD = 'PSR2'; |
10
|
|
|
const PHPUNIT_OPTIONS = '--suite default'; |
11
|
|
|
const RIGHT_MESSAGE = 'good job'; |
12
|
|
|
const REGULAR_EXPRESSION = '#[0-9]{2,7}'; |
13
|
|
|
const ERROR_MESSAGE = 'fix your code'; |
14
|
|
|
const PHPMD_OPTIONS = '--minimumpriority 1'; |
15
|
|
|
const PHPCSFIXER_OPTIONS = '--diff'; |
16
|
|
|
const MINIMUM_COVERAGE = 90.00; |
17
|
|
|
const EMPTY_STRING = ''; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* @return array |
21
|
|
|
*/ |
22
|
|
|
public static function hooksEnabledWithEnabledTools() |
23
|
|
|
{ |
24
|
|
|
return [ |
25
|
|
|
'pre-commit' => [ |
26
|
|
|
'enabled' => true, |
27
|
|
|
'execute' => [ |
28
|
|
|
'composer' => true, |
29
|
|
|
'jsonlint' => true, |
30
|
|
|
'phplint' => true, |
31
|
|
|
'phpmd' => [ |
32
|
|
|
'enabled' => true, |
33
|
|
|
'options' => self::PHPMD_OPTIONS |
34
|
|
|
], |
35
|
|
|
'phpcs' => [ |
36
|
|
|
'enabled' => true, |
37
|
|
|
'standard' => static::PHPCS_STANDARD, |
38
|
|
|
'ignore' => static::EMPTY_STRING, |
39
|
|
|
], |
40
|
|
|
'php-cs-fixer' => [ |
41
|
|
|
'enabled' => true, |
42
|
|
|
'levels' => [ |
43
|
|
|
'psr0' => true, |
44
|
|
|
'psr1' => true, |
45
|
|
|
'psr2' => true, |
46
|
|
|
'symfony' => true, |
47
|
|
|
], |
48
|
|
|
'options' => static::PHPCSFIXER_OPTIONS, |
49
|
|
|
], |
50
|
|
|
'phpunit' => [ |
51
|
|
|
'enabled' => true, |
52
|
|
|
'random-mode' => true, |
53
|
|
|
'options' => static::PHPUNIT_OPTIONS, |
54
|
|
|
'strict-coverage' => [ |
55
|
|
|
'enabled' => true, |
56
|
|
|
'minimum' => self::MINIMUM_COVERAGE |
57
|
|
|
], |
58
|
|
|
'guard-coverage' => [ |
59
|
|
|
'enabled' => true, |
60
|
|
|
'message' => self::ERROR_MESSAGE |
61
|
|
|
], |
62
|
|
|
], |
63
|
|
|
], |
64
|
|
|
'message' => [ |
65
|
|
|
'right-message' => static::RIGHT_MESSAGE, |
66
|
|
|
'error-message' => static::ERROR_MESSAGE, |
67
|
|
|
], |
68
|
|
|
], |
69
|
|
|
'commit-msg' => [ |
70
|
|
|
'enabled' => true, |
71
|
|
|
'regular-expression' => static::REGULAR_EXPRESSION, |
72
|
|
|
], |
73
|
|
|
'pre-push' => [ |
74
|
|
|
'enabled' => true, |
75
|
|
|
'execute' => [ |
76
|
|
|
'phpunit' => [ |
77
|
|
|
'enabled' => true, |
78
|
|
|
'random-mode' => true, |
79
|
|
|
'options' => static::PHPUNIT_OPTIONS, |
80
|
|
|
'strict-coverage' => [ |
81
|
|
|
'enabled' => true, |
82
|
|
|
'minimum' => self::MINIMUM_COVERAGE |
83
|
|
|
], |
84
|
|
|
'guard-coverage' => [ |
85
|
|
|
'enabled' => true, |
86
|
|
|
'message' => self::ERROR_MESSAGE |
87
|
|
|
], |
88
|
|
|
] |
89
|
|
|
], |
90
|
|
|
'message' => [ |
91
|
|
|
'right-message' => HookQuestions::PRE_PUSH_RIGHT_MESSAGE_DEFAULT, |
92
|
|
|
'error-message' => HookQuestions::PRE_PUSH_ERROR_MESSAGE_DEFAULT, |
93
|
|
|
] |
94
|
|
|
] |
95
|
|
|
]; |
96
|
|
|
} |
97
|
|
|
} |
98
|
|
|
|