Skip to content

Commit

Permalink
[NodeNestingScope] Remove ScopeAwareNodeFinder::findParentType (#2214)
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed May 2, 2022
1 parent 464b74c commit 6bb8973
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions packages/NodeNestingScope/NodeFinder/ScopeAwareNodeFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,6 @@ public function __construct(
) {
}

/**
* Find node based on $callable or null, when the nesting scope is broken
* @param array<class-string<Node>> $allowedTypes
*/
public function findParentType(Node $node, array $allowedTypes): ?Node
{
$callable = function (Node $node) use ($allowedTypes): bool {
foreach ($allowedTypes as $allowedType) {
if (! is_a($node, $allowedType)) {
continue;
}

return true;
}

return false;
};

return $this->findParent($node, $callable, $allowedTypes);
}

/**
* Find node based on $callable or null, when the nesting scope is broken
* @param callable(Node $node): bool $callable
Expand Down

0 comments on commit 6bb8973

Please sign in to comment.