예제 #1
0
파일: Matcher.php 프로젝트: unx/Matcher
 /** Creates new Matcher that executes $this matcher and if nothing is found
  * (results is null or empty array), executes second matcher. */
 function orElse($m)
 {
     $self = $this->f;
     return new Matcher(function ($node, $context = null) use($self, $m) {
         $context = Matcher::inventContext($context);
         return $self($node, $context) ?: Matcher::_evalPath($node, $m, $context);
     });
 }