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);
    }
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);
    }
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 ) ; }
Creates a new instance of NodeFactory with default Parser ands Traverser.

@param int $kind One of ParserFactory::PREFER_PHP7,
ParserFactory::PREFER_PHP5, ParserFactory::ONLY_PHP7 or ParserFactory::ONLY_PHP5
@return static
Creates a new instance of NodeFactory with default Parser ands Traverser .