public static function getRoot(NodeInterface $parent): ?PhpFileModelInterface
    {
        while ($parent !== null) {
            if ($parent instanceof PhpFileModelInterface) {
                return $parent;
            }
            $parent = $parent->getParentNode();
        }
        return null;
    }