Chris@13: name = null !== $name ? BuilderHelpers::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@13: $this->stmts[] = BuilderHelpers::normalizeStmt($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@13: public function getNode() : Node { Chris@0: return new Stmt\Namespace_($this->name, $this->stmts, $this->attributes); Chris@0: } Chris@0: }