pub struct ClassLikeReflection {Show 16 fields
pub attribute_reflections: Vec<AttributeReflection>,
pub name: ClassLikeName,
pub inheritance: InheritanceReflection,
pub constants: HashMap<StringIdentifier, ClassLikeConstantReflection>,
pub cases: MemeberCollection<EnumCaseReflection>,
pub properties: MemeberCollection<PropertyReflection>,
pub methods: MemeberCollection<FunctionLikeReflection>,
pub used_traits: HashSet<StringIdentifier>,
pub used_trait_names: HashMap<StringIdentifier, Name>,
pub backing_type: Option<TypeReflection>,
pub is_final: bool,
pub is_readonly: bool,
pub is_abstract: bool,
pub is_anonymous: bool,
pub span: Span,
pub is_populated: bool,
}Expand description
Represents reflection data for a PHP class, interface, enum, or trait.
Fields§
§attribute_reflections: Vec<AttributeReflection>§name: ClassLikeName§inheritance: InheritanceReflection§constants: HashMap<StringIdentifier, ClassLikeConstantReflection>§cases: MemeberCollection<EnumCaseReflection>§properties: MemeberCollection<PropertyReflection>§methods: MemeberCollection<FunctionLikeReflection>§used_traits: HashSet<StringIdentifier>§used_trait_names: HashMap<StringIdentifier, Name>§backing_type: Option<TypeReflection>§is_final: bool§is_readonly: bool§is_abstract: bool§is_anonymous: bool§span: Span§is_populated: boolImplementations§
Source§impl ClassLikeReflection
impl ClassLikeReflection
pub fn is_trait(&self) -> bool
pub fn is_interface(&self) -> bool
pub fn is_class(&self) -> bool
pub fn is_enum(&self) -> bool
pub fn is_anonymous_class(&self) -> bool
Sourcepub fn extends_class(&self, class_like_identifier: &Name) -> bool
pub fn extends_class(&self, class_like_identifier: &Name) -> bool
Checks if this class-like entity extends the given class.
Sourcepub fn implements_interface(&self, interface_identifier: &Name) -> bool
pub fn implements_interface(&self, interface_identifier: &Name) -> bool
Checks if this class-like entity implements the given interface.
Sourcepub fn extends_interface(&self, interface_identifier: &Name) -> bool
pub fn extends_interface(&self, interface_identifier: &Name) -> bool
Checks if this interface extends the given interface.
Sourcepub fn uses_trait(&self, trait_identifier: &StringIdentifier) -> bool
pub fn uses_trait(&self, trait_identifier: &StringIdentifier) -> bool
Checks if this class-like entity uses the given trait.
Sourcepub fn has_constant(&self, constant_name: &StringIdentifier) -> bool
pub fn has_constant(&self, constant_name: &StringIdentifier) -> bool
Checks if this class-like entity contains a constant with the given name.
Sourcepub fn has_enum_case(&self, case_name: &StringIdentifier) -> bool
pub fn has_enum_case(&self, case_name: &StringIdentifier) -> bool
Checks if this class-like entity contains an enum case with the given name.
Sourcepub fn has_property(&self, property_name: &StringIdentifier) -> bool
pub fn has_property(&self, property_name: &StringIdentifier) -> bool
Checks if this class-like entity has a property with the given name.
Sourcepub fn has_method(&self, method_name: &StringIdentifier) -> bool
pub fn has_method(&self, method_name: &StringIdentifier) -> bool
Checks if this class-like entity has a method with the given name.
Sourcepub fn get_constant(
&self,
constant_name: &StringIdentifier,
) -> Option<&ClassLikeConstantReflection>
pub fn get_constant( &self, constant_name: &StringIdentifier, ) -> Option<&ClassLikeConstantReflection>
Retrieves a constant by name, if it exists.
Sourcepub fn get_enum_case(
&self,
case_name: &StringIdentifier,
) -> Option<&EnumCaseReflection>
pub fn get_enum_case( &self, case_name: &StringIdentifier, ) -> Option<&EnumCaseReflection>
Retrieves an enum case by name, if it exists.
Sourcepub fn get_property(
&self,
property_name: &StringIdentifier,
) -> Option<&PropertyReflection>
pub fn get_property( &self, property_name: &StringIdentifier, ) -> Option<&PropertyReflection>
Retrieves a property by name, if it exists.
Sourcepub fn get_method(
&self,
method_name: &StringIdentifier,
) -> Option<&FunctionLikeReflection>
pub fn get_method( &self, method_name: &StringIdentifier, ) -> Option<&FunctionLikeReflection>
Retrieves a method by name, if it exists.
Trait Implementations§
Source§impl Clone for ClassLikeReflection
impl Clone for ClassLikeReflection
Source§fn clone(&self) -> ClassLikeReflection
fn clone(&self) -> ClassLikeReflection
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more