/** * @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]; }
/** * @inheritdoc */ public function isShouldParseRelationships(StackReadOnlyInterface $stack) { if ($stack->count() < 2) { // top level, no resources ware started to parse yet $shouldContinue = true; } else { // on the way to included paths $currentPath = $stack->end()->getPath(); $currentRootType = $stack->root()->getResource()->getType(); $shouldContinue = $this->parameterAnalyzer->isPathIncluded($currentPath, $currentRootType); } return $shouldContinue; }