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