PluginProbe
WPIDE – File Manager & Code Editor / 3.5.9
WPIDE – File Manager & Code Editor v3.5.9
3.5.9 3.5.8 3.5.7 2.0.14 2.0.15 2.0.16 2.0.2 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1 2.2 2.3 2.3.1 2.3.2 2.4.0 2.5 2.6 3.0 3.1 3.2 3.3 All 55 releases
wpide / vendor / nikic / php-parser / lib / PhpParser / Builder / Namespace_.php

Namespace_.php in WPIDE – File Manager & Code Editor 3.5.9, at vendor/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php

46 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php declare(strict_types=1);
2
3 namespace PhpParser\Builder;
4
5 use PhpParser;
6 use PhpParser\BuilderHelpers;
7 use PhpParser\Node;
8 use PhpParser\Node\Stmt;
9
10 class Namespace_ extends Declaration
11 {
12 private $name;
13 private $stmts = [];
14
15 /**
16 * Creates a namespace builder.
17 *
18 * @param Node\Name|string|null $name Name of the namespace
19 */
20 public function __construct($name) {
21 $this->name = null !== $name ? BuilderHelpers::normalizeName($name) : null;
22 }
23
24 /**
25 * Adds a statement.
26 *
27 * @param Node|PhpParser\Builder $stmt The statement to add
28 *
29 * @return $this The builder instance (for fluid interface)
30 */
31 public function addStmt($stmt) {
32 $this->stmts[] = BuilderHelpers::normalizeStmt($stmt);
33
34 return $this;
35 }
36
37 /**
38 * Returns the built node.
39 *
40 * @return Stmt\Namespace_ The built node
41 */
42 public function getNode() : Node {
43 return new Stmt\Namespace_($this->name, $this->stmts, $this->attributes);
44 }
45 }
46