Example #1
0
 /**
  * Creates a new, blank PHP source file.
  *
  * @param string|NULL $ns
  *  If provided, the new document will have this namespace added to it.
  *
  * @return static
  */
 public static function create($ns = NULL)
 {
     $node = new RootNode();
     $node->addChild(Token::openTag());
     if (is_string($ns) && $ns) {
         NamespaceNode::create($ns)->appendTo($node)->after(Token::newline());
     }
     return $node;
 }