pub struct FunctionLikeReflection {Show 18 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,
pub issues: IssueCollection,
}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 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.
issues: IssueCollectionCollection of issues associated with this function-like entity.
Implementations§
Source§impl FunctionLikeReflection
impl FunctionLikeReflection
Sourcepub fn is_function(&self) -> bool
pub fn is_function(&self) -> bool
Checks if this entity is a function.
Sourcepub fn is_property_hook(&self) -> bool
pub fn is_property_hook(&self) -> bool
Checks if this entity is a property hook.
Sourcepub fn is_closure(&self) -> bool
pub fn is_closure(&self) -> bool
Checks if this entity is a closure.
Sourcepub fn is_arrow_function(&self) -> bool
pub fn is_arrow_function(&self) -> bool
Checks if this entity is an arrow function.
Trait Implementations§
Source§impl Clone for FunctionLikeReflection
impl Clone for FunctionLikeReflection
Source§fn clone(&self) -> FunctionLikeReflection
fn clone(&self) -> FunctionLikeReflection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FunctionLikeReflection
impl Debug for FunctionLikeReflection
Source§impl<'de> Deserialize<'de> for FunctionLikeReflection
impl<'de> Deserialize<'de> for FunctionLikeReflection
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<&FunctionLikeReflection> for TypeKind
impl From<&FunctionLikeReflection> for TypeKind
Source§fn from(reflection: &FunctionLikeReflection) -> Self
fn from(reflection: &FunctionLikeReflection) -> Self
Source§impl HasSource for FunctionLikeReflection
impl HasSource for FunctionLikeReflection
Source§fn source(&self) -> SourceIdentifier
fn source(&self) -> SourceIdentifier
Returns the source identifier of the file containing this function-like entity.
Source§impl HasSpan for FunctionLikeReflection
impl HasSpan for FunctionLikeReflection
Source§impl Hash for FunctionLikeReflection
impl Hash for FunctionLikeReflection
Source§impl PartialEq for FunctionLikeReflection
impl PartialEq for FunctionLikeReflection
Source§fn eq(&self, other: &FunctionLikeReflection) -> bool
fn eq(&self, other: &FunctionLikeReflection) -> bool
self and other values to be equal, and is used by ==.Source§impl Reflection for FunctionLikeReflection
impl Reflection for FunctionLikeReflection
Source§fn get_category(&self) -> SourceCategory
fn get_category(&self) -> SourceCategory
Returns the source category of the function-like entity.
Source§fn is_populated(&self) -> bool
fn is_populated(&self) -> bool
Indicates whether the function-like entity’s reflection data is fully populated.
If is_populated is false, additional processing may be required to resolve
all metadata for this entity.