src/PhpGitHooks/Application/CodeSniffer/PhpCsConfigData.php 1 location
|
@@ 39-53 (lines=15) @@
|
36 |
|
return self::TOOL; |
37 |
|
} |
38 |
|
|
39 |
|
private function setEnabled() |
40 |
|
{ |
41 |
|
if (!isset($this->configData[self::TOOL])) { |
42 |
|
$answer = $this->setQuestion( |
43 |
|
sprintf('Do you want enable %s tool: ', strtoupper(self::TOOL)), |
44 |
|
self::DEFAULT_ANSWER, |
45 |
|
'[Y/n]' |
46 |
|
); |
47 |
|
$answer = self::DEFAULT_ANSWER === strtoupper($answer) ? true : false; |
48 |
|
} else { |
49 |
|
$answer = $this->configData[self::TOOL][self::ENABLED_KEY]; |
50 |
|
} |
51 |
|
|
52 |
|
$this->enableTool($answer); |
53 |
|
} |
54 |
|
|
55 |
|
private function setStandard() |
56 |
|
{ |
src/PhpGitHooks/Application/PhpCsFixer/PhpCsFixerConfigData.php 1 location
|
@@ 77-92 (lines=16) @@
|
74 |
|
/** |
75 |
|
* @throws InvalidPhpCsFixerConfigDataException |
76 |
|
*/ |
77 |
|
private function setEnabled() |
78 |
|
{ |
79 |
|
if (!isset($this->configData[self::TOOL])) { |
80 |
|
$answer = $this->setQuestion( |
81 |
|
sprintf('Do you want enable %s tool: ', strtoupper(self::TOOL)), |
82 |
|
self::DEFAULT_ANSWER, |
83 |
|
'[Y/n]' |
84 |
|
); |
85 |
|
$answer = self::DEFAULT_ANSWER === strtoupper($answer) ? true : false; |
86 |
|
} else { |
87 |
|
$this->checkConfigData(); |
88 |
|
$answer = $this->configData[self::TOOL][self::ENABLED_KEY]; |
89 |
|
} |
90 |
|
|
91 |
|
$this->enableTool($answer); |
92 |
|
} |
93 |
|
} |
94 |
|
|
src/PhpGitHooks/Application/PhpUnit/PhpUnitConfigData.php 1 location
|
@@ 97-112 (lines=16) @@
|
94 |
|
$this->configData[self::TOOL][self::RANDOM_MODE_KEY] = $answer; |
95 |
|
} |
96 |
|
|
97 |
|
private function setEnabled() |
98 |
|
{ |
99 |
|
if (!isset($this->configData[self::TOOL])) { |
100 |
|
$answer = $this->setQuestion( |
101 |
|
sprintf('Do you want enable %s tool: ', strtoupper(self::TOOL)), |
102 |
|
self::DEFAULT_ANSWER, |
103 |
|
'Y/n' |
104 |
|
); |
105 |
|
$answer = self::DEFAULT_ANSWER === strtoupper($answer) ? true : false; |
106 |
|
} else { |
107 |
|
$this->checkConfigData(); |
108 |
|
$answer = $this->configData[self::TOOL][self::ENABLED_KEY]; |
109 |
|
} |
110 |
|
|
111 |
|
$this->enableTool($answer); |
112 |
|
} |
113 |
|
} |
114 |
|
|