pub struct ClassLikeReflection {Show 17 fields
pub attribute_reflections: Vec<AttributeReflection>,
pub name: ClassLikeName,
pub inheritance: InheritanceReflection,
pub constants: HashMap<StringIdentifier, ClassLikeConstantReflection>,
pub cases: HashMap<StringIdentifier, EnumCaseReflection>,
pub properties: MemeberCollection<PropertyReflection>,
pub methods: MemeberCollection<FunctionLikeReflection>,
pub used_traits: HashSet<Name>,
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,
pub issues: IssueCollection,
}Expand description
Represents reflection data for a PHP class, interface, enum, or trait.
Fields§
§attribute_reflections: Vec<AttributeReflection>Attributes (e.g., annotations) associated with the class-like entity.
name: ClassLikeNameThe name of the class-like entity, such as its fully qualified name.
inheritance: InheritanceReflectionInheritance information for the class-like entity, including parent classes and implemented interfaces.
constants: HashMap<StringIdentifier, ClassLikeConstantReflection>Constants defined in the class-like entity.
cases: HashMap<StringIdentifier, EnumCaseReflection>Enum cases defined in the class-like entity, if it is an enum.
properties: MemeberCollection<PropertyReflection>Properties defined in the class-like entity.
methods: MemeberCollection<FunctionLikeReflection>Methods defined in the class-like entity.
used_traits: HashSet<Name>Traits used by the class-like entity.
used_trait_names: HashMap<StringIdentifier, Name>Traits used by the class-like entity.
backing_type: Option<TypeReflection>The backing type of the entity, used if it is an enum.
is_final: boolWhether the class-like entity is declared as final.
is_readonly: boolWhether the class-like entity is declared as readonly.
is_abstract: boolWhether the class-like entity is declared as abstract.
is_anonymous: boolWhether the entity is an anonymous class.
span: SpanThe span in the source code where the class-like entity is declared.
is_populated: boolIndicates whether the reflection is fully populated with all metadata.
issues: IssueCollectionIssues encountered while processing the class-like entity.
Implementations§
Source§impl ClassLikeReflection
impl ClassLikeReflection
pub fn new(name: ClassLikeName, span: Span) -> Self
Sourcepub const fn is_interface(&self) -> bool
pub const fn is_interface(&self) -> bool
Checks if this class-like entity is an interface.
Sourcepub const fn is_anonymous_class(&self) -> bool
pub const fn is_anonymous_class(&self) -> bool
Checks if this class-like entity is a trait.
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 moreSource§impl Debug for ClassLikeReflection
impl Debug for ClassLikeReflection
Source§impl<'de> Deserialize<'de> for ClassLikeReflection
impl<'de> Deserialize<'de> for ClassLikeReflection
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 HasSource for ClassLikeReflection
impl HasSource for ClassLikeReflection
Source§fn source(&self) -> SourceIdentifier
fn source(&self) -> SourceIdentifier
Returns the source identifier of the file containing this class-like entity.
The source identifier provides metadata about the origin of the entity, such as whether it is user-defined, vendor-provided, or built-in.
Source§impl HasSpan for ClassLikeReflection
impl HasSpan for ClassLikeReflection
Source§impl PartialEq for ClassLikeReflection
impl PartialEq for ClassLikeReflection
Source§impl Reflection for ClassLikeReflection
impl Reflection for ClassLikeReflection
Source§fn get_category(&self) -> SourceCategory
fn get_category(&self) -> SourceCategory
Returns the source category of the class-like entity.
The category indicates whether the entity is part of the project (UserDefined),
vendor-provided (Vendor), or built-in (BuiltIn).
Source§fn is_populated(&self) -> bool
fn is_populated(&self) -> bool
Indicates whether the class-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.