@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | |
77 | 77 | protected function convertAttributes($attributes) |
78 | 78 | { |
79 | - foreach($attributes as $k=>$attribute) |
|
79 | + foreach ($attributes as $k=>$attribute) |
|
80 | 80 | { |
81 | 81 | $attributes[$k] = $this->convertValue($attribute); |
82 | 82 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | |
139 | 139 | if (is_array($this->value)) { |
140 | 140 | $results = []; |
141 | - foreach($this->value as $value) { |
|
141 | + foreach ($this->value as $value) { |
|
142 | 142 | if ($value instanceof XMLReaderElement) { |
143 | 143 | $results[] = $value; |
144 | 144 | } |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | if ($this->name == $search) |
162 | 162 | $results[] = $this; |
163 | 163 | |
164 | - foreach($this->children() as $child) { |
|
164 | + foreach ($this->children() as $child) { |
|
165 | 165 | $results = array_merge($results, $child->find($search)); |
166 | 166 | } |
167 | 167 | |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | { |
179 | 179 | /* Access the Elements Attributes */ |
180 | 180 | if (is_array($this->value)) { |
181 | - foreach($this->value as $value) { |
|
181 | + foreach ($this->value as $value) { |
|
182 | 182 | if ($value instanceof XMLReaderElement && $value->name == $name) { |
183 | 183 | return $value; |
184 | 184 | } |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | |
203 | 203 | if (!empty($this->children())) { |
204 | 204 | $names = []; |
205 | - foreach($this->children() as $child) { |
|
205 | + foreach ($this->children() as $child) { |
|
206 | 206 | $names[] = $child->name; |
207 | 207 | } |
208 | 208 |
@@ -158,8 +158,9 @@ discard block |
||
158 | 158 | |
159 | 159 | $results = []; |
160 | 160 | |
161 | - if ($this->name == $search) |
|
162 | - $results[] = $this; |
|
161 | + if ($this->name == $search) { |
|
162 | + $results[] = $this; |
|
163 | + } |
|
163 | 164 | |
164 | 165 | foreach($this->children() as $child) { |
165 | 166 | $results = array_merge($results, $child->find($search)); |
@@ -167,8 +168,9 @@ discard block |
||
167 | 168 | |
168 | 169 | if ($search[0] == '@') { |
169 | 170 | $search = substr($search, 1); |
170 | - if (property_exists($this->attributes, $search)) |
|
171 | - $results[] = $this->attributes->$search; |
|
171 | + if (property_exists($this->attributes, $search)) { |
|
172 | + $results[] = $this->attributes->$search; |
|
173 | + } |
|
172 | 174 | } |
173 | 175 | |
174 | 176 | return $results; |