src/PhpGitHooks/Module/Configuration/Service/ComposerConfigurator.php 1 location
|
@@ 9-27 (lines=19) @@
|
6 |
|
use PhpGitHooks\Module\Configuration\Domain\Composer; |
7 |
|
use PhpGitHooks\Module\Configuration\Domain\Enabled; |
8 |
|
|
9 |
|
class ComposerConfigurator |
10 |
|
{ |
11 |
|
/** |
12 |
|
* @param IOInterface $io |
13 |
|
* @param Composer $composer |
14 |
|
* |
15 |
|
* @return Composer |
16 |
|
*/ |
17 |
|
public static function configure(IOInterface $io, Composer $composer) |
18 |
|
{ |
19 |
|
if (true === $composer->isUndefined()) { |
20 |
|
$answer = $io->ask(HookQuestions::COMPOSER_TOOL, HookQuestions::DEFAULT_TOOL_ANSWER); |
21 |
|
$composer = $composer |
22 |
|
->setEnabled(new Enabled(HookQuestions::DEFAULT_TOOL_ANSWER === strtoupper($answer))); |
23 |
|
} |
24 |
|
|
25 |
|
return $composer; |
26 |
|
} |
27 |
|
} |
28 |
|
|
src/PhpGitHooks/Module/Configuration/Service/JsonLintConfigurator.php 1 location
|
@@ 9-26 (lines=18) @@
|
6 |
|
use PhpGitHooks\Module\Configuration\Domain\Enabled; |
7 |
|
use PhpGitHooks\Module\Configuration\Domain\JsonLint; |
8 |
|
|
9 |
|
class JsonLintConfigurator |
10 |
|
{ |
11 |
|
/** |
12 |
|
* @param IOInterface $io |
13 |
|
* @param JsonLint $jsonLint |
14 |
|
* |
15 |
|
* @return JsonLint |
16 |
|
*/ |
17 |
|
public static function configure(IOInterface $io, JsonLint $jsonLint) |
18 |
|
{ |
19 |
|
if (true === $jsonLint->isUndefined()) { |
20 |
|
$answer = $io->ask(HookQuestions::JSONLINT_TOOL, HookQuestions::DEFAULT_TOOL_ANSWER); |
21 |
|
$jsonLint = $jsonLint->setEnabled(new Enabled(HookQuestions::DEFAULT_TOOL_ANSWER === strtoupper($answer))); |
22 |
|
} |
23 |
|
|
24 |
|
return $jsonLint; |
25 |
|
} |
26 |
|
} |
27 |
|
|
src/PhpGitHooks/Module/Configuration/Service/PhpLintConfigurator.php 1 location
|
@@ 9-26 (lines=18) @@
|
6 |
|
use PhpGitHooks\Module\Configuration\Domain\Enabled; |
7 |
|
use PhpGitHooks\Module\Configuration\Domain\PhpLint; |
8 |
|
|
9 |
|
class PhpLintConfigurator |
10 |
|
{ |
11 |
|
/** |
12 |
|
* @param IOInterface $io |
13 |
|
* @param PhpLint $phpLint |
14 |
|
* |
15 |
|
* @return PhpLint |
16 |
|
*/ |
17 |
|
public static function configure(IOInterface $io, PhpLint $phpLint) |
18 |
|
{ |
19 |
|
if (true === $phpLint->isUndefined()) { |
20 |
|
$answer = $io->ask(HookQuestions::PHPLINT_TOOL, HookQuestions::DEFAULT_TOOL_ANSWER); |
21 |
|
$phpLint = $phpLint->setEnabled(new Enabled(HookQuestions::DEFAULT_TOOL_ANSWER === strtoupper($answer))); |
22 |
|
} |
23 |
|
|
24 |
|
return $phpLint; |
25 |
|
} |
26 |
|
} |
27 |
|
|