1 | <?php |
||
32 | final class NamespaceStmtCollection implements IteratorAggregate, Countable |
||
33 | { |
||
34 | /** |
||
35 | * @var Namespace_[] |
||
36 | */ |
||
37 | private $nodes = []; |
||
38 | |||
39 | /** |
||
40 | * @var Name|null[] Associative array with the potentially prefixed namespace names as keys and their original name |
||
41 | * as value. |
||
42 | */ |
||
43 | private $mapping = []; |
||
44 | |||
45 | /** |
||
46 | * @param Namespace_ $node New namespace, may have been prefixed. |
||
47 | * @param Namespace_ $originalName Original unchanged namespace. |
||
48 | */ |
||
49 | 518 | public function add(Namespace_ $node, Namespace_ $originalName) |
|
55 | |||
56 | 414 | public function findNamespaceForNode(Node $node): ?Name |
|
69 | |||
70 | 256 | public function findNamespaceByName(string $name): ?Name |
|
80 | |||
81 | public function getCurrentNamespaceName(): ?Name |
||
89 | 189 | ||
90 | /** |
||
91 | * @inheritdoc |
||
92 | */ |
||
93 | 189 | public function count(): int |
|
97 | |||
98 | private function getNodeNamespace(Node $node): ?Name |
||
112 | |||
113 | /** |
||
114 | * @inheritdoc |
||
115 | */ |
||
116 | public function getIterator(): iterable |
||
120 | } |
||
121 |