Walk a class member to find method bodies and run the forward walker.
(
member: &'b mago_syntax::ast::class_like::member::ClassLikeMember<'b>,
enclosing_class: &ClassInfo,
diag_ctx: &DiagnosticWalkCtx<'_>,
)
| 1701 | |
| 1702 | /// Walk a class member to find method bodies and run the forward walker. |
| 1703 | fn walk_class_member_body<'b>( |
| 1704 | member: &'b mago_syntax::ast::class_like::member::ClassLikeMember<'b>, |
| 1705 | enclosing_class: &ClassInfo, |
| 1706 | diag_ctx: &DiagnosticWalkCtx<'_>, |
| 1707 | ) { |
| 1708 | use mago_syntax::ast::class_like::member::ClassLikeMember; |
| 1709 | use mago_syntax::ast::class_like::method::MethodBody; |
| 1710 | |
| 1711 | if let ClassLikeMember::Method(method) = member |
| 1712 | && let MethodBody::Concrete(block) = &method.body |
| 1713 | { |
| 1714 | let method_name = method.name.value.to_string(); |
| 1715 | let is_static = method.modifiers.contains_static(); |
| 1716 | analyze_function_body( |
| 1717 | method.parameter_list.parameters.iter(), |
| 1718 | block.statements.iter(), |
| 1719 | method.span().start.offset, |
| 1720 | enclosing_class, |
| 1721 | Some(&method_name), |
| 1722 | is_static, |
| 1723 | diag_ctx, |
| 1724 | ); |
| 1725 | } |
| 1726 | } |
| 1727 | |
| 1728 | /// Bundles the immutable context needed by [`analyze_function_body`] and |
| 1729 | /// the AST walkers so we don't pass 5+ individual arguments everywhere. |
no test coverage detected