1 | <?php |
||
29 | final class NamespaceStmtCollection implements IteratorAggregate, Countable |
||
30 | { |
||
31 | /** |
||
32 | * @var Namespace_[] |
||
33 | */ |
||
34 | private $nodes = []; |
||
35 | |||
36 | /** |
||
37 | * @var Name|null[] Associative array with the potentially prefixed namespace names as keys and their original name |
||
38 | * as value. |
||
39 | */ |
||
40 | private $mapping = []; |
||
41 | |||
42 | /** |
||
43 | * @param Namespace_ $node New namespace, may have been prefixed. |
||
44 | * @param Namespace_ $originalName Original unchanged namespace. |
||
45 | */ |
||
46 | public function add(Namespace_ $node, Namespace_ $originalName) |
||
52 | |||
53 | public function findNamespaceForNode(Node $node): ?Name |
||
65 | |||
66 | public function getCurrentNamespaceName(): ?Name |
||
74 | |||
75 | /** |
||
76 | * @inheritdoc |
||
77 | */ |
||
78 | public function count(): int |
||
82 | |||
83 | private function getNodeNamespace(Node $node): ?Name |
||
97 | |||
98 | /** |
||
99 | * @inheritdoc |
||
100 | */ |
||
101 | public function getIterator(): iterable |
||
105 | } |
||
106 |