@@ 175-186 (lines=12) @@ | ||
172 | * @param Node[] $ast |
|
173 | * @return Generator |
|
174 | */ |
|
175 | protected function extractMethods(array $ast) |
|
176 | { |
|
177 | foreach ($ast as $node) { |
|
178 | if (!isset($node->stmts)) { |
|
179 | continue; |
|
180 | } |
|
181 | ||
182 | foreach ($this->iterageStmts($node->stmts) as $stmt) { |
|
183 | yield $stmt; |
|
184 | } |
|
185 | } |
|
186 | } |
|
187 | ||
188 | protected function iterageStmts(array $stmts) |
|
189 | { |
|
@@ 188-203 (lines=16) @@ | ||
185 | } |
|
186 | } |
|
187 | ||
188 | protected function iterageStmts(array $stmts) |
|
189 | { |
|
190 | foreach ($stmts as $stmt) { |
|
191 | if ($stmt instanceof Node\Stmt\ClassMethod) { |
|
192 | yield $stmt; |
|
193 | } |
|
194 | ||
195 | if (!isset($stmt->stmts)) { |
|
196 | continue; |
|
197 | } |
|
198 | ||
199 | foreach ($this->iterageStmts($stmt->stmts) as $stmt) { |
|
200 | yield $stmt; |
|
201 | } |
|
202 | } |
|
203 | } |
|
204 | ||
205 | protected function extractNamespace(array $ast) |
|
206 | { |