PhpGitHooks\Module\PhpCs\Contract\CommandHandler\PhpCsToolCommandHandler::handle PHP Метод

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

public handle ( Bruli\EventBusBundle\CommandBus\CommandInterface $command )
$command Bruli\EventBusBundle\CommandBus\CommandInterface
    public function handle(CommandInterface $command)
    {
        $this->phpCsTool->execute($command->getFiles(), $command->getStandard(), $command->getErrorMessage());
    }

Usage Example

 /**
  * @test
  */
 public function itShouldWorksFine()
 {
     $output = new PreCommitOutputWriter(PhpCsTool::EXECUTE_MESSAGE);
     $files = FilesCommittedStub::createOnlyPhpFiles();
     $this->shouldWriteOutput($output->getMessage());
     foreach ($files as $file) {
         $this->shouldProcessPhpCsTool($file, 'PSR2', null);
     }
     $this->shouldWriteLnOutput($output->getSuccessfulMessage());
     $this->phpCsToolCommandHandler->handle(new PhpCsToolCommand($files, 'PSR2', HookQuestions::PRE_COMMIT_ERROR_MESSAGE_DEFAULT));
 }
PhpCsToolCommandHandler