/** * @param StackReadOnlyInterface $stack * * @return bool[] */ private function foundInPaths(StackReadOnlyInterface $stack) { if ($stack->count() < 2) { // top level, no resources ware started to parse yet $onTheWay = true; $parentIsTarget = false; } else { $onTheWay = $this->parameters->hasMatchWithIncludedPaths($stack->end()->getPath()); $parentIsTarget = $this->parameters->isPathIncluded($stack->penult()->getPath()); } return [$onTheWay, $parentIsTarget]; }
/** * @param Frame $current * @param Frame|null $previous * * @return bool[] */ private function getIfTargets(Frame $current, Frame $previous = null) { $parentIsTarget = $previous === null || $this->parameters->isPathIncluded($previous->getPath()); $currentIsTarget = $this->parameters->isPathIncluded($current->getPath()); return [$parentIsTarget, $currentIsTarget]; }