Chris@0: name = null !== $name ? $this->normalizeName($name) : null; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Adds a statement. Chris@0: * Chris@0: * @param Node|PhpParser\Builder $stmt The statement to add Chris@0: * Chris@0: * @return $this The builder instance (for fluid interface) Chris@0: */ Chris@0: public function addStmt($stmt) { Chris@0: $this->stmts[] = $this->normalizeNode($stmt); Chris@0: Chris@0: return $this; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Returns the built node. Chris@0: * Chris@0: * @return Node The built node Chris@0: */ Chris@0: public function getNode() { Chris@0: return new Stmt\Namespace_($this->name, $this->stmts, $this->attributes); Chris@0: } Chris@0: }