PhpGitHooks\Module\Git\Contract\CommandHandler\PreCommitToolCommandHandler::handle PHP Метод

handle() публичный Метод

public handle ( Bruli\EventBusBundle\CommandBus\CommandInterface $command )
$command Bruli\EventBusBundle\CommandBus\CommandInterface
    public function handle(CommandInterface $command)
    {
        $this->preCommitTool->execute();
    }

Usage Example

 /**
  * @test
  */
 public function itShouldExecuteAllTools()
 {
     $files = FilesCommittedStub::createAllFiles();
     $configurationDataResponse = ConfigurationDataResponseStub::createAllEnabled();
     $this->shouldWriteTitle(PreCommitTool::TITLE, 'title');
     $this->shouldGetFilesCommitted($files);
     $this->shouldHandleQuery(new ConfigurationDataFinderQuery(), $configurationDataResponse);
     $this->shouldHandleCommand(new ComposerToolCommand($files, $configurationDataResponse->getPreCommit()->getErrorMessage()));
     $this->shouldHandleCommand(new JsonLintToolCommand($files, $configurationDataResponse->getPreCommit()->getErrorMessage()));
     $this->shouldHandleQuery(new PhpFilesExtractorQuery($files), PhpFilesResponseStub::create(FilesCommittedStub::createWithoutPhpFiles()));
     $this->shouldHandleCommand(new PhpLintToolCommand($files, $configurationDataResponse->getPreCommit()->getErrorMessage()));
     $this->shouldHandleCommand(new PhpCsToolCommand($files, $configurationDataResponse->getPreCommit()->getPhpCs()->getPhpCsStandard(), HookQuestions::PRE_COMMIT_ERROR_MESSAGE_DEFAULT));
     $this->shouldHandleCommand(new PhpCsFixerToolCommand($files, $configurationDataResponse->getPreCommit()->getPhpCsFixer()->isPhpCsFixerPsr0(), $configurationDataResponse->getPreCommit()->getPhpCsFixer()->isPhpCsFixerPsr1(), $configurationDataResponse->getPreCommit()->getPhpCsFixer()->isPhpCsFixerPsr2(), $configurationDataResponse->getPreCommit()->getPhpCsFixer()->isPhpCsFixerSymfony(), $configurationDataResponse->getPreCommit()->getPhpCsFixer()->getPhpCsFixerOptions(), $configurationDataResponse->getPreCommit()->getErrorMessage()));
     $this->shouldHandleCommand(new PhpMdToolCommand($files, $configurationDataResponse->getPreCommit()->getPhpMd()->getPhpMdOptions(), $configurationDataResponse->getPreCommit()->getErrorMessage()));
     $this->shouldHandleCommand(new PhpUnitToolCommand($configurationDataResponse->getPreCommit()->getPhpUnit()->isPhpunitRandomMode(), $configurationDataResponse->getPreCommit()->getPhpUnit()->getPhpunitOptions(), $configurationDataResponse->getPreCommit()->getErrorMessage()));
     $this->shouldHandleCommand(new StrictCoverageCommand($configurationDataResponse->getPreCommit()->getPhpUnitStrictCoverage()->getMinimum(), $configurationDataResponse->getPreCommit()->getErrorMessage()));
     $this->shouldHandleCommand(new GuardCoverageCommand($configurationDataResponse->getPreCommit()->getPhpUnitGuardCoverage()->getWarningMessage()));
     $this->shouldWriteLnOutput(GoodJobLogoResponse::paint($configurationDataResponse->getPreCommit()->getRightMessage()));
     $this->preCommitToolCommandHandler->handle(new PreCommitToolCommand());
 }
PreCommitToolCommandHandler