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