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