true, 'indexes' => true]; $constantExpressionParser = new ConstExprParser(true, true, $usedAttributes); $parser = new PhpDocParser( new TypeParser($constantExpressionParser, true, $usedAttributes), $constantExpressionParser, true, true, $usedAttributes, true, true ); } return $parser; } public static function getPrinter(): Printer { static $printer; if ($printer === null) { $printer = new Printer(); } return $printer; } /** * @template T of Node * @param T $node * @return T */ public static function cloneNode(Node $node): Node { static $cloningTraverser; if ($cloningTraverser === null) { $cloningTraverser = new NodeTraverser([new CloningVisitor()]); } [$cloneNode] = $cloningTraverser->traverse([$node]); return $cloneNode; } }