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

Returns the new regex.
public __toString ( ) : string
Результат string
Пример #1
0
 /**
  * @param ContextInterface|GitCommitMsgContext $context
  */
 public function run(ContextInterface $context)
 {
     $config = $this->getConfiguration();
     $commitMessage = $context->getCommitMessage();
     foreach ($config['matchers'] as $rule) {
         $regex = new Regex($rule);
         if ((bool) $config['case_insensitive']) {
             $regex->addPatternModifier('i');
         }
         if ((bool) $config['multiline']) {
             $regex->addPatternModifier('m');
         }
         if (!preg_match($regex->__toString(), $commitMessage)) {
             throw new RuntimeException(sprintf('The commit message does not match the rule: %s', $rule));
         }
     }
 }