Methods |
public
|
__toString(): non-empty-string
|
#
|
public
static
|
createFromInstance(object $instance): self
Create a ReflectionClass from an instance, using default reflectors etc. This is simply a helper method that calls ReflectionObject::createFromInstance().
Create a ReflectionClass from an instance, using default reflectors etc. This is simply a helper method that calls ReflectionObject::createFromInstance().
Throws
Overridden by
|
#
|
public
|
getShortName(): non-empty-string
Get the "short" name of the class (e.g. for A\B\Foo, this will return
"Foo").
Get the "short" name of the class (e.g. for A\B\Foo, this will return
"Foo").
Overridden by
|
#
|
public
|
getName(): class-string|trait-string
Get the "full" name of the class (e.g. for A\B\Foo, this will return
"A\B\Foo").
Get the "full" name of the class (e.g. for A\B\Foo, this will return
"A\B\Foo").
Overridden by
Implements
|
#
|
public
|
getParentClassName(): class-string|null
|
#
|
public
|
getNamespaceName(): non-empty-string|null
Get the "namespace" name of the class (e.g. for A\B\Foo, this will
return "A\B").
Get the "namespace" name of the class (e.g. for A\B\Foo, this will
return "A\B").
Overridden by
|
#
|
public
|
inNamespace(): bool
Decide if this class is part of a namespace. Returns false if the class
is in the global namespace or does not have a specified namespace.
Decide if this class is part of a namespace. Returns false if the class
is in the global namespace or does not have a specified namespace.
Overridden by
|
#
|
public
|
getExtensionName(): non-empty-string|null
|
#
|
public
|
getMethods(int-mask-of<ReflectionMethod::IS_*> $filter = 0): array<non-empty-string, ReflectionMethod>
Fetch an array of all methods for this class. Filter the results to include only methods with certain attributes. Defaults
to no filtering.
Any combination of \ReflectionMethod::IS_STATIC,
\ReflectionMethod::IS_PUBLIC,
\ReflectionMethod::IS_PROTECTED,
\ReflectionMethod::IS_PRIVATE,
\ReflectionMethod::IS_ABSTRACT,
\ReflectionMethod::IS_FINAL.
For example if $filter = \ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_FINAL
the only the final public methods will be returned
Fetch an array of all methods for this class. Filter the results to include only methods with certain attributes. Defaults
to no filtering.
Any combination of \ReflectionMethod::IS_STATIC,
\ReflectionMethod::IS_PUBLIC,
\ReflectionMethod::IS_PROTECTED,
\ReflectionMethod::IS_PRIVATE,
\ReflectionMethod::IS_ABSTRACT,
\ReflectionMethod::IS_FINAL.
For example if $filter = \ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_FINAL
the only the final public methods will be returned
Overridden by
|
#
|
public
|
getImmediateMethods(int-mask-of<ReflectionMethod::IS_*> $filter = 0): array<non-empty-string, ReflectionMethod>
Get only the methods that this class implements (i.e. do not search
up parent classes etc.)
Get only the methods that this class implements (i.e. do not search
up parent classes etc.)
Overridden by
|
#
|
public
|
getMethod(non-empty-string $methodName): ?ReflectionMethod
Get a single method with the name $methodName.
Get a single method with the name $methodName.
Overridden by
|
#
|
public
|
hasMethod(non-empty-string $methodName): bool
Does the class have the specified method?
Does the class have the specified method?
Overridden by
|
#
|
public
|
getImmediateConstants(
int-mask-of<ReflectionClassConstant::IS_*> $filter = 0,
): array<non-empty-string, ReflectionClassConstant>
Get an associative array of only the constants for this specific class (i.e. do not search
up parent classes etc.), with keys as constant names and values as ReflectionClassConstant objects.
Get an associative array of only the constants for this specific class (i.e. do not search
up parent classes etc.), with keys as constant names and values as ReflectionClassConstant objects.
Returns
Overridden by
|
#
|
public
|
hasConstant(non-empty-string $name): bool
Does this class have the specified constant?
Does this class have the specified constant?
Overridden by
|
#
|
public
|
getConstant(non-empty-string $name): ?ReflectionClassConstant
Get the reflection object of the specified class constant. Returns null if not specified.
Get the reflection object of the specified class constant. Returns null if not specified.
Overridden by
|
#
|
public
|
getConstants(int-mask-of<ReflectionClassConstant::IS_*> $filter = 0): array<non-empty-string, ReflectionClassConstant>
Get an associative array of the defined constants in this class,
with keys as constant names and values as ReflectionClassConstant objects.
Get an associative array of the defined constants in this class,
with keys as constant names and values as ReflectionClassConstant objects.
Returns
Overridden by
|
#
|
public
|
getConstructor(): ?ReflectionMethod
Get the constructor method for this class.
Get the constructor method for this class.
Overridden by
|
#
|
public
|
getImmediateProperties(int-mask-of<ReflectionProperty::IS_*> $filter = 0): array<non-empty-string, ReflectionProperty>
Get only the properties for this specific class (i.e. do not search
up parent classes etc.)
Get only the properties for this specific class (i.e. do not search
up parent classes etc.)
Overridden by
|
#
|
public
|
getProperties(int-mask-of<ReflectionProperty::IS_*> $filter = 0): array<non-empty-string, ReflectionProperty>
Get the properties for this class. Filter the results to include only properties with certain attributes. Defaults
to no filtering.
Any combination of \ReflectionProperty::IS_STATIC,
\ReflectionProperty::IS_PUBLIC,
\ReflectionProperty::IS_PROTECTED,
\ReflectionProperty::IS_PRIVATE.
For example if $filter = \ReflectionProperty::IS_STATIC | \ReflectionProperty::IS_PUBLIC
only the static public properties will be returned
Get the properties for this class. Filter the results to include only properties with certain attributes. Defaults
to no filtering.
Any combination of \ReflectionProperty::IS_STATIC,
\ReflectionProperty::IS_PUBLIC,
\ReflectionProperty::IS_PROTECTED,
\ReflectionProperty::IS_PRIVATE.
For example if $filter = \ReflectionProperty::IS_STATIC | \ReflectionProperty::IS_PUBLIC
only the static public properties will be returned
Overridden by
|
#
|
public
|
getProperty(non-empty-string $name): ?ReflectionProperty
Get the property called $name. Returns null if property does not exist.
Get the property called $name. Returns null if property does not exist.
Overridden by
|
#
|
public
|
hasProperty(non-empty-string $name): bool
Does this class have the specified property?
Does this class have the specified property?
Overridden by
|
#
|
public
|
getDefaultProperties(): array<non-empty-string, mixed>
|
#
|
public
|
getFileName(): non-empty-string|null
|
#
|
public
|
getLocatedSource(): LocatedSource
|
#
|
public
|
getStartLine(): positive-int
Get the line number that this class starts on.
Get the line number that this class starts on.
Overridden by
|
#
|
public
|
getEndLine(): positive-int
Get the line number that this class ends on.
Get the line number that this class ends on.
Overridden by
|
#
|
public
|
getStartColumn(): positive-int
|
#
|
public
|
getEndColumn(): positive-int
|
#
|
public
|
getParentClass(): ?ReflectionClass
Get the parent class, if it is defined.
Get the parent class, if it is defined.
Overridden by
|
#
|
public
|
getParentClassNames(): list<class-string>
Gets the parent class names.
Gets the parent class names.
Returns
A numerical array with parent class names as the values.
Overridden by
|
#
|
public
|
getDocComment(): non-empty-string|null
|
#
|
public
|
isAnonymous(): bool
|
#
|
public
|
isInternal(): bool
Is this an internal class?
Is this an internal class?
Overridden by
|
#
|
public
|
isUserDefined(): bool
Is this a user-defined function (will always return the opposite of
whatever isInternal returns).
Is this a user-defined function (will always return the opposite of
whatever isInternal returns).
Overridden by
|
#
|
public
|
isDeprecated(): bool
|
#
|
public
|
isAbstract(): bool
Is this class an abstract class.
Is this class an abstract class.
Overridden by
|
#
|
public
|
isFinal(): bool
Is this class a final class.
Is this class a final class.
Overridden by
|
#
|
public
|
isReadOnly(): bool
|
#
|
public
|
getModifiers(): int-mask-of<ReflectionClass::IS_*>
Get the core-reflection-compatible modifier values.
Get the core-reflection-compatible modifier values.
Overridden by
|
#
|
public
|
isTrait(): bool
Is this reflection a trait?
Is this reflection a trait?
Overridden by
|
#
|
public
|
isInterface(): bool
Is this reflection an interface?
Is this reflection an interface?
Overridden by
|
#
|
public
|
getTraits(): list<ReflectionClass>
Get the traits used, if any are defined. If this class does not have any
defined traits, this will return an empty array.
Get the traits used, if any are defined. If this class does not have any
defined traits, this will return an empty array.
Overridden by
|
#
|
public
|
getTraitClassNames(): list<trait-string>
|
#
|
public
|
getTraitNames(): list<trait-string>
Get the names of the traits used as an array of strings, if any are
defined. If this class does not have any defined traits, this will
return an empty array.
Get the names of the traits used as an array of strings, if any are
defined. If this class does not have any defined traits, this will
return an empty array.
Overridden by
|
#
|
public
|
getTraitAliases(): array<non-empty-string, non-empty-string>
Return a list of the aliases used when importing traits for this class.
The returned array is in key/value pair in this format:. 'aliasedMethodName' => 'ActualClass::actualMethod'
Return a list of the aliases used when importing traits for this class.
The returned array is in key/value pair in this format:. 'aliasedMethodName' => 'ActualClass::actualMethod'
Overridden by
|
#
|
public
|
getInterfaceClassNames(): list<class-string>
|
#
|
public
|
getInterfaces(): array<class-string, self>
Returns
An associative array of interfaces, with keys as interface names and the array
values as ReflectionClass objects.
Overridden by
|
#
|
public
|
getImmediateInterfaces(): array<class-string, self>
Get only the interfaces that this class implements (i.e. do not search
up parent classes etc.)
Get only the interfaces that this class implements (i.e. do not search
up parent classes etc.)
Overridden by
|
#
|
public
|
getInterfaceNames(): list<class-string>
Gets the interface names.
Gets the interface names.
Returns
A numerical array with interface names as the values.
Overridden by
|
#
|
public
|
isInstance(object $object): bool
Checks whether the given object is an instance.
Checks whether the given object is an instance.
Overridden by
|
#
|
public
|
isSubclassOf(string $className): bool
Checks whether the given class string is a subclass of this class.
Checks whether the given class string is a subclass of this class.
Overridden by
|
#
|
public
|
implementsInterface(string $interfaceName): bool
Checks whether this class implements the given interface.
Checks whether this class implements the given interface.
Overridden by
|
#
|
public
|
isInstantiable(): bool
Checks whether this reflection is an instantiable class
Checks whether this reflection is an instantiable class
Overridden by
|
#
|
public
|
isCloneable(): bool
Checks whether this is a reflection of a class that supports the clone operator
Checks whether this is a reflection of a class that supports the clone operator
Overridden by
|
#
|
public
|
isIterateable(): bool
|
#
|
public
|
isEnum(): bool
|
#
|
public
|
getStaticPropertyValue(non-empty-string $propertyName): mixed
Get the value of a static property, if it exists. Throws a
PropertyDoesNotExist exception if it does not exist or is not static.
(note, differs very slightly from internal reflection behaviour)
Get the value of a static property, if it exists. Throws a
PropertyDoesNotExist exception if it does not exist or is not static.
(note, differs very slightly from internal reflection behaviour)
Throws
Overridden by
|
#
|
public
|
setStaticPropertyValue(non-empty-string $propertyName, mixed $value): void
Set the value of a static property
Set the value of a static property
Throws
Overridden by
|
#
|
public
|
getStaticProperties(): array<non-empty-string, mixed>
|
#
|
public
|
getAttributes(): list<ReflectionAttribute>
|
#
|
public
|
getAttributesByName(string $name): list<ReflectionAttribute>
|
#
|
public
|
getAttributesByInstance(class-string $className): list<ReflectionAttribute>
|
#
|