PhpGitHooks\Module\PhpMd\Model\PhpMdToolProcessorInterface::process PHP Method

process() public method

public process ( string $file, string $options ) : string
$file string
$options string
return string
    public function process($file, $options);

Usage Example

Example #1
0
 /**
  * @param array  $files
  * @param string $options
  * @param string $errorMessage
  *
  * @throws PhpMdViolationsException
  */
 public function execute(array $files, $options, $errorMessage)
 {
     $outputMessage = new PreCommitOutputWriter(self::CHECKING_MESSAGE);
     $this->output->write($outputMessage->getMessage());
     $errors = [];
     foreach ($files as $file) {
         $errors[] = $this->phpMdToolProcessor->process($file, $options);
     }
     $errors = array_filter($errors);
     if (!empty($errors)) {
         $outputText = $outputMessage->setError(implode('', $errors));
         $this->output->writeln($outputMessage->getFailMessage());
         $this->output->writeln($outputText);
         $this->output->writeln(BadJobLogoResponse::paint($errorMessage));
         throw new PhpMdViolationsException();
     }
     $this->output->writeln($outputMessage->getSuccessfulMessage());
 }
PhpMdToolProcessorInterface