public static function createInstance($kind = ParserFactory::PREFER_PHP7): self
    {
        $parser = (new ParserFactory())->create($kind);
        $traverser = new NodeTraverser();
        $traverser->addVisitor(new NameResolver());
        $traverser->addVisitor(new ElementNameResolver());
        return new static($parser, $traverser);
    }