pub struct MethodDef {Show 20 fields
pub name: Arc<str>,
pub fqcn: Arc<str>,
pub params: Arc<[FnParam]>,
pub return_type: Option<Arc<Type>>,
pub inferred_return_type: Option<Arc<Type>>,
pub visibility: Visibility,
pub is_static: bool,
pub is_abstract: bool,
pub is_final: bool,
pub is_constructor: bool,
pub template_params: Vec<TemplateParam>,
pub assertions: Vec<Assertion>,
pub throws: Vec<Arc<str>>,
pub deprecated: Option<Arc<str>>,
pub is_internal: bool,
pub is_pure: bool,
pub is_override: bool,
pub location: Option<Location>,
pub docstring: Option<Arc<str>>,
pub is_virtual: bool,
}Fields§
§name: Arc<str>§fqcn: Arc<str>§params: Arc<[FnParam]>§return_type: Option<Arc<Type>>Type from annotation (@return / native type hint). None means unannotated.
Stored as Option<Arc<Type>> to enable deduplication of common return types
(e.g., void, string, mixed, bool) across thousands of methods.
inferred_return_type: Option<Arc<Type>>Type inferred from body analysis. Stored as Option<Arc<Type>> (8 B) rather
than inline Option<Type> (176 B, no niche) — inference is now demand-driven
via salsa (inferred_*_return_type_demand), so this field is a rarely/never
populated fallback; shrinking it saves ~168 B on every MethodDef.
visibility: Visibility§is_static: bool§is_abstract: bool§is_final: bool§is_constructor: bool§template_params: Vec<TemplateParam>§assertions: Vec<Assertion>§throws: Vec<Arc<str>>§deprecated: Option<Arc<str>>§is_internal: bool§is_pure: bool§is_override: boolTrue when the method has the #[Override] PHP attribute.
location: Option<Location>§docstring: Option<Arc<str>>Plain-text description from the docblock (text before @tag lines).
Used for hover info.
is_virtual: boolTrue for methods added via @method docblock annotations. Virtual
methods must not be required as concrete interface implementations.