fsFactory)($basePath); $result = []; /** @var MatcherInterface $matcher */ foreach ($this->matchers as $matcher) { if (($match = $matcher->match($fs, $path)) instanceof EmptyMatchResult) { continue; } $result[] = $match; if ($matchersLimit > 0 && count($result) >= $matchersLimit) { break; } } return $result; } }