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

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

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

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);
 }
ComposerConfigurator