> $types * @return T|null */ public function findByTypes(\PhpParser\Node $node, array $types) : ?\PhpParser\Node { \RectorPrefix20210916\Webmozart\Assert\Assert::allIsAOf($types, \PhpParser\Node::class); $parent = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE); if (!$parent instanceof \PhpParser\Node) { return null; } do { foreach ($types as $type) { if (\is_a($parent, $type, \true)) { return $parent; } } if ($parent === null) { return null; } } while ($parent = $parent->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE)); return null; } }