(&mut self, node: Node<'t>)
| 671 | // --- extractors ---------------------------------------------------------------- |
| 672 | |
| 673 | fn extract_function(&mut self, node: Node<'t>) { |
| 674 | let name = self.extract_name(node); |
| 675 | if name == "<anonymous>" { |
| 676 | if let Some(body) = node.child_by_field_name("body") { |
| 677 | self.visit_function_body(body); |
| 678 | } |
| 679 | return; |
| 680 | } |
| 681 | let extra = Extra { |
| 682 | docstring: preceding_docstring(node, self.src), |
| 683 | signature: None, // no getSignature hook |
| 684 | visibility: Some(self.visibility_of(node)), |
| 685 | is_static: Some(self.is_static(node)), |
| 686 | return_type: self.return_type_of(node), |
| 687 | }; |
| 688 | let Some(row) = self.create_node("function", &name, node, extra) else { return }; |
| 689 | self.extract_php_type_refs(node, row); |
| 690 | // decorators: none. |
| 691 | self.stack.push(Scope { row, kind: "function", name }); |
| 692 | if let Some(body) = node.child_by_field_name("body") { |
| 693 | self.visit_function_body(body); |
| 694 | } |
| 695 | self.stack.pop(); |
| 696 | } |
| 697 | |
| 698 | fn extract_method(&mut self, node: Node<'t>) { |
| 699 | let name = self.extract_name(node); |
no test coverage detected