Skip to main content

Module walk

Module walk 

Source

Functions§

class_refs_in_stmts
new ClassName, extends ClassName, implements ClassName, type hints, and $x instanceof ClassName. Does NOT match free function calls or method names with the same spelling.
collect_var_refs_in_scope
Collect all $var_name spans within the innermost function/method scope that contains byte_off. If byte_off is not inside any function, collects from the top-level stmts (respecting scope boundaries). Also collects the parameter declaration span when the variable is a parameter of the scope.
function_refs_in_stmts
Collect spans where name is called as a free function (not a method). Only matches name(...) calls where the callee is a bare identifier, not $obj->name() or Class::name().
method_refs_in_stmts
Collect spans where name is used as a method: ->name(), ?->name(), ::name(). Does NOT match free function calls or class-name identifiers.
new_refs_in_stmts
Collect spans for new ClassName(...) expressions only — excludes type hints, instanceof, extends, implements, and static calls.
property_refs_in_stmts
Collect all spans where prop_name is accessed (->prop, ?->prop) or declared as a class/trait property, across all statements.
refs_in_stmts
refs_in_stmts_with_use
Like refs_in_stmts, but also matches spans inside use statements. Needed so that renaming a class also renames its use import.
var_refs_in_stmts
Collect all spans where $var_name (the variable name WITHOUT $) appears as an ExprKind::Variable within stmts. Stops at nested function/closure/arrow-function scope boundaries so that $x in an inner function is not conflated with $x in the outer function.