@@ 166-177 (lines=12) @@ | ||
163 | * @param Node[] $ast |
|
164 | * @return Generator |
|
165 | */ |
|
166 | protected function extractMethods(array $ast) |
|
167 | { |
|
168 | foreach ($ast as $node) { |
|
169 | if (!isset($node->stmts)) { |
|
170 | continue; |
|
171 | } |
|
172 | ||
173 | foreach ($this->iterageStmts($node->stmts) as $stmt) { |
|
174 | yield $stmt; |
|
175 | } |
|
176 | } |
|
177 | } |
|
178 | ||
179 | protected function iterageStmts(array $stmts) |
|
180 | { |
|
@@ 179-194 (lines=16) @@ | ||
176 | } |
|
177 | } |
|
178 | ||
179 | protected function iterageStmts(array $stmts) |
|
180 | { |
|
181 | foreach ($stmts as $stmt) { |
|
182 | if ($stmt instanceof Node\Stmt\ClassMethod) { |
|
183 | yield $stmt; |
|
184 | } |
|
185 | ||
186 | if (!isset($stmt->stmts)) { |
|
187 | continue; |
|
188 | } |
|
189 | ||
190 | foreach ($this->iterageStmts($stmt->stmts) as $stmt) { |
|
191 | yield $stmt; |
|
192 | } |
|
193 | } |
|
194 | } |
|
195 | ||
196 | protected function extractNamespace(array $ast) |
|
197 | { |