PhpGitHooks\Module\Git\Service\CommitMsgTool::run PHP Метод

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

public run ( Symfony\Component\Console\Input\InputInterface $input )
$input Symfony\Component\Console\Input\InputInterface
    public function run(InputInterface $input)
    {
        /** @var ConfigurationDataResponse $configurationDataResponse */
        $configurationDataResponse = $this->queryBus->handle(new ConfigurationDataFinderQuery());
        if (true === $configurationDataResponse->getCommitMsg()->isCommitMsg()) {
            $commitContent = $this->commitMessageFinder->find($input->getFirstArgument());
            $validMessage = $this->isValidCommitMessage($configurationDataResponse->getCommitMsg()->getRegularExpression(), $commitContent);
            if (false === $validMessage) {
                throw new InvalidCommitMessageException();
            }
        }
    }

Usage Example

 /**
  * @param CommandInterface|CommitMsgCommand $command
  */
 public function handle(CommandInterface $command)
 {
     $this->commitMsgTool->run($command->getInput());
 }