PhpGitHooks\Module\Composer\Service\ComposerTool::execute PHP Метод

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

public execute ( array $files, string $errorMessage )
$files array
$errorMessage string
    public function execute(array $files, $errorMessage)
    {
        $composerFilesResponse = $this->getComposerFilesResponse($files);
        $this->outputMessage = new PreCommitOutputWriter(self::CHECKING_MESSAGE);
        if (true === $composerFilesResponse->isExists()) {
            $this->output->write($this->outputMessage->getMessage());
            $this->executeTool($composerFilesResponse->isJsonFile(), $composerFilesResponse->isLockFile(), $errorMessage);
            $this->output->writeln($this->outputMessage->getSuccessfulMessage());
        }
    }

Usage Example

 /**
  * @param CommandInterface|ComposerToolCommand $command
  */
 public function handle(CommandInterface $command)
 {
     $this->composerTool->execute($command->getFiles(), $command->getErrorMessage());
 }