3 declare(strict_types = 1);
27 protected const RULE_PATTERN =
'#(?:\'(?<instruction>[^\']+)\')|(?<source>[^\s]+)#';
47 if (preg_match_all(self::RULE_PATTERN, $rule, $matches)) {
48 foreach (array_keys($matches[0]) as $index) {
49 if ($matches[
'instruction'][$index] !==
'') {
50 $this->instructions[] = $matches[
'instruction'][$index];
51 } elseif ($matches[
'source'][$index] !==
'') {
52 $this->sources[] = $matches[
'source'][$index];
81 return array_intersect($this->instructions,
$instructions) !== [];