@@ 188-199 (lines=12) @@ | ||
185 | * @param Node[] $ast |
|
186 | * @return Generator |
|
187 | */ |
|
188 | protected function extractMethods(array $ast) |
|
189 | { |
|
190 | foreach ($ast as $node) { |
|
191 | if (!isset($node->stmts)) { |
|
192 | continue; |
|
193 | } |
|
194 | ||
195 | foreach ($this->iterageStmts($node->stmts) as $stmt) { |
|
196 | yield $stmt; |
|
197 | } |
|
198 | } |
|
199 | } |
|
200 | ||
201 | protected function iterageStmts(array $stmts) |
|
202 | { |
|
@@ 201-216 (lines=16) @@ | ||
198 | } |
|
199 | } |
|
200 | ||
201 | protected function iterageStmts(array $stmts) |
|
202 | { |
|
203 | foreach ($stmts as $stmt) { |
|
204 | if ($stmt instanceof Node\Stmt\ClassMethod) { |
|
205 | yield $stmt; |
|
206 | } |
|
207 | ||
208 | if (!isset($stmt->stmts)) { |
|
209 | continue; |
|
210 | } |
|
211 | ||
212 | foreach ($this->iterageStmts($stmt->stmts) as $stmt) { |
|
213 | yield $stmt; |
|
214 | } |
|
215 | } |
|
216 | } |
|
217 | ||
218 | protected function extractNamespace(array $ast) |
|
219 | { |