1 | <?php |
||
11 | class ElementIterator extends XMLIterator |
||
12 | { |
||
13 | /** |
||
14 | * @var int |
||
15 | */ |
||
16 | private $index; |
||
|
|||
17 | |||
18 | /** |
||
19 | * @var string |
||
20 | */ |
||
21 | private $name; |
||
22 | |||
23 | /** |
||
24 | * @var bool |
||
25 | */ |
||
26 | private $didRewind; |
||
27 | |||
28 | /** |
||
29 | * @param XMLReader $reader |
||
30 | * @param null|string $name element name, leave empty or use '*' for all elements |
||
31 | */ |
||
32 | 8 | public function __construct(XMLReader $reader, $name = null) |
|
38 | |||
39 | /** |
||
40 | * @return void |
||
41 | */ |
||
42 | 8 | public function rewind() |
|
50 | |||
51 | /** |
||
52 | * @return Node|null |
||
53 | */ |
||
54 | 8 | public function current() |
|
61 | |||
62 | 1 | public function key() |
|
66 | |||
67 | 7 | public function next() |
|
75 | |||
76 | /** |
||
77 | * @return array |
||
78 | */ |
||
79 | 1 | public function toArray() |
|
104 | |||
105 | /** |
||
106 | * @return string |
||
107 | */ |
||
108 | 2 | public function __toString() |
|
112 | |||
113 | /** |
||
114 | * decorate method calls |
||
115 | * |
||
116 | * @param string $name |
||
117 | * @param array $args |
||
118 | * |
||
119 | * @return mixed |
||
120 | */ |
||
121 | 2 | public function __call($name, $args) |
|
125 | |||
126 | /** |
||
127 | * decorate property get |
||
128 | * |
||
129 | * @param string $name |
||
130 | * |
||
131 | * @return string |
||
132 | */ |
||
133 | public function __get($name) |
||
137 | |||
138 | /** |
||
139 | * @param null|string $name |
||
140 | */ |
||
141 | 8 | public function setName($name = null) |
|
145 | |||
146 | /** |
||
147 | * take care the underlying XMLReader is at an element with a fitting name (if $this is looking for a name) |
||
148 | */ |
||
149 | 8 | private function ensureCurrentElementState() |
|
157 | } |
||
158 |