PhpGitHooks\Module\Configuration\Service\PhpLintConfigurator::configure PHP Метод

configure() публичный статический Метод

public static configure ( Composer\IO\IOInterface $io, PhpLint $phpLint ) : PhpLint
$io Composer\IO\IOInterface
$phpLint PhpGitHooks\Module\Configuration\Domain\PhpLint
Результат PhpGitHooks\Module\Configuration\Domain\PhpLint
    public static function configure(IOInterface $io, PhpLint $phpLint)
    {
        if (true === $phpLint->isUndefined()) {
            $answer = $io->ask(HookQuestions::PHPLINT_TOOL, HookQuestions::DEFAULT_TOOL_ANSWER);
            $phpLint = $phpLint->setEnabled(new Enabled(HookQuestions::DEFAULT_TOOL_ANSWER === strtoupper($answer)));
        }
        return $phpLint;
    }

Usage Example

Пример #1
0
 /**
  * @param ExecuteInterface $execute
  *
  * @return ExecuteInterface
  */
 private function configTools(ExecuteInterface $execute)
 {
     $tools = $execute->execute();
     $tools[0] = ComposerConfigurator::configure($this->io, $tools[0]);
     $tools[1] = JsonLintConfigurator::configure($this->io, $tools[1]);
     $tools[2] = PhpLintConfigurator::configure($this->io, $tools[2]);
     $tools[3] = PhpMdConfigurator::configure($this->io, $tools[3]);
     $tools[4] = PhpCsConfigurator::configure($this->io, $tools[4]);
     $tools[5] = PhpCsFixerConfigurator::configure($this->io, $tools[5]);
     $tools[6] = PhpUnitConfigurator::configure($this->io, $tools[6]);
     $tools[7] = PhpUnitStrictCoverageConfigurator::configure($this->io, $tools[7]);
     $tools[8] = $this->phpUnitGuardCoverageConfigurator->configure($this->io, $tools[8]);
     return new Execute($tools);
 }
PhpLintConfigurator