| @@ 234-251 (lines=18) @@ | ||
| 231 | */ |
|
| 232 | } |
|
| 233 | // Method or Function |
|
| 234 | elseif ($node instanceof N\Stmt\ClassMethod) { |
|
| 235 | $type = Variable::METHOD_TYPE; |
|
| 236 | $id = $this->insert->entity |
|
| 237 | ( $type |
|
| 238 | , $node->name |
|
| 239 | , $this->file_path |
|
| 240 | , $start_line |
|
| 241 | , $end_line |
|
| 242 | , $source |
|
| 243 | ); |
|
| 244 | ||
| 245 | // TODO: reimplement this in some other way. |
|
| 246 | /* |
|
| 247 | foreach ($this->listeners as $listener) { |
|
| 248 | $listener->on_enter_method($id, $node); |
|
| 249 | } |
|
| 250 | */ |
|
| 251 | } |
|
| 252 | elseif ($node instanceof N\Stmt\Function_) { |
|
| 253 | $type = Variable::FUNCTION_TYPE; |
|
| 254 | $id = $this->insert->entity |
|
| @@ 252-269 (lines=18) @@ | ||
| 249 | } |
|
| 250 | */ |
|
| 251 | } |
|
| 252 | elseif ($node instanceof N\Stmt\Function_) { |
|
| 253 | $type = Variable::FUNCTION_TYPE; |
|
| 254 | $id = $this->insert->entity |
|
| 255 | ( $type |
|
| 256 | , $node->name |
|
| 257 | , $this->file_path |
|
| 258 | , $start_line |
|
| 259 | , $end_line |
|
| 260 | , $source |
|
| 261 | ); |
|
| 262 | ||
| 263 | // TODO: reimplement this in some other way. |
|
| 264 | /* |
|
| 265 | foreach ($this->listeners as $listener) { |
|
| 266 | $listener->on_enter_function($id, $node); |
|
| 267 | } |
|
| 268 | */ |
|
| 269 | } |
|
| 270 | else { |
|
| 271 | foreach ($this->listeners["misc"] as $listener) { |
|
| 272 | $listener($this->insert, $this, $node); |
|