1 | <?php |
||
28 | final class UseStmtCollection implements IteratorAggregate |
||
29 | { |
||
30 | /** |
||
31 | * @var Use_[][] |
||
32 | */ |
||
33 | private $nodes = [ |
||
34 | null => [], |
||
35 | ]; |
||
36 | |||
37 | 191 | public function add(?Name $namespaceName, Use_ $node): void |
|
41 | |||
42 | /** |
||
43 | * Finds the statements matching the given name. |
||
44 | * |
||
45 | * $name = 'Foo'; |
||
46 | * |
||
47 | * use X; |
||
48 | * use Bar\Foo; |
||
49 | * use Y; |
||
50 | * |
||
51 | * will return the use statement for `Bar\Foo`. |
||
52 | * |
||
53 | * @param Name|null $namespaceName |
||
54 | * @param Name $node |
||
55 | * |
||
56 | * @return null|Name |
||
57 | */ |
||
58 | 156 | public function findStatementForNode(?Name $namespaceName, Name $node): ?Name |
|
79 | |||
80 | /** |
||
81 | * @inheritdoc |
||
82 | */ |
||
83 | public function getIterator(): iterable |
||
87 | } |
||
88 |