pub struct FunctionLikeReflection {Show 17 fields
    pub attribute_reflections: Vec<AttributeReflection>,
    pub visibility_reflection: Option<ClassLikeMemberVisibilityReflection>,
    pub name: FunctionLikeName,
    pub templates: Vec<Template>,
    pub parameters: Vec<FunctionLikeParameterReflection>,
    pub return_type_reflection: Option<FunctionLikeReturnTypeReflection>,
    pub returns_by_reference: bool,
    pub has_yield: bool,
    pub has_throws: bool,
    pub is_anonymous: bool,
    pub is_static: bool,
    pub is_final: bool,
    pub is_abstract: bool,
    pub is_pure: bool,
    pub is_overriding: bool,
    pub span: Span,
    pub is_populated: bool,
}Expand description
Represents reflection data for a function-like entity, such as a function or method.
This includes details about its parameters, return type, attributes, and various properties like visibility, overrides, and whether it supports specific PHP features.
Fields§
§attribute_reflections: Vec<AttributeReflection>Attributes associated with this function-like entity.
visibility_reflection: Option<ClassLikeMemberVisibilityReflection>Visibility information for this function-like if it is a class member.
name: FunctionLikeNameThe unique identifier for this function or method.
templates: Vec<Template>The list of templates accepted by this function or method.
parameters: Vec<FunctionLikeParameterReflection>The list of parameters accepted by this function or method, including their types and attributes.
return_type_reflection: Option<FunctionLikeReturnTypeReflection>The return type of this function or method, if specified.
returns_by_reference: boolIndicates whether the function or method returns by reference.
has_yield: boolFlags if the function or method contains a yield expression, indicating it is a generator.
has_throws: boolFlags if the function or method has the potential to throw an exception.
is_anonymous: boolIndicates if this function-like entity is anonymous (i.e., a closure or an anonymous function).
For functions and methods, this is always false.
is_static: boolIndicates if this function or method is static.
This is always false for functions; for closures, arrow functions, and methods, it depends on their declaration.
is_final: boolIndicates if this function or method is declared as final.
This is always true for functions, arrow functions, and closures. For methods, it depends on the declaration.
is_abstract: boolIndicates if this function or method is abstract.
Always false for functions, arrow functions, and closures. For methods, it depends on the declaration.
is_pure: boolIndicates if this function or method is pure.
is_overriding: boolFlags if this function or method overrides a method from a parent class.
Always false for functions, arrow functions, and closures. For methods,
it depends on whether they override a parent method.
span: SpanThe span in the source code where this function or method is defined.
is_populated: boolIndicate if this function-like entity is populated.
Implementations§
Source§impl FunctionLikeReflection
 
impl FunctionLikeReflection
pub fn is_function(&self) -> bool
pub fn is_method(&self) -> bool
pub fn is_property_hook(&self) -> bool
pub fn is_closure(&self) -> bool
pub fn is_arrow_function(&self) -> bool
Trait Implementations§
Source§impl Clone for FunctionLikeReflection
 
impl Clone for FunctionLikeReflection
Source§fn clone(&self) -> FunctionLikeReflection
 
fn clone(&self) -> FunctionLikeReflection
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
source. Read more