1 | <?php |
||
31 | final class NamespaceStmtCollection implements IteratorAggregate, Countable |
||
32 | { |
||
33 | /** |
||
34 | * @var Namespace_[] |
||
35 | */ |
||
36 | private $nodes = []; |
||
37 | |||
38 | /** |
||
39 | * @var Name|null[] Associative array with the potentially prefixed namespace names as keys and their original name |
||
40 | * as value. |
||
41 | */ |
||
42 | private $mapping = []; |
||
43 | |||
44 | /** |
||
45 | * @param Namespace_ $node New namespace, may have been prefixed. |
||
46 | * @param Namespace_ $originalName Original unchanged namespace. |
||
47 | */ |
||
48 | 368 | public function add(Namespace_ $node, Namespace_ $originalName) |
|
54 | |||
55 | 190 | public function findNamespaceForNode(Node $node): ?Name |
|
68 | |||
69 | 204 | public function getCurrentNamespaceName(): ?Name |
|
77 | |||
78 | /** |
||
79 | * @inheritdoc |
||
80 | */ |
||
81 | public function count(): int |
||
85 | |||
86 | 89 | private function getNodeNamespace(Node $node): ?Name |
|
100 | |||
101 | /** |
||
102 | * @inheritdoc |
||
103 | */ |
||
104 | public function getIterator(): iterable |
||
108 | } |
||
109 |