Methods |
public
|
__toString(): string
|
#
|
public
static
|
createFromName(string $className): self
Create a ReflectionClass by name, using default reflectors etc.
Create a ReflectionClass by name, using default reflectors etc.
Deprecated
Throws
|
#
|
public
static
|
createFromInstance(object $instance): self
Create a ReflectionClass from an instance, using default reflectors etc.
Create a ReflectionClass from an instance, using default reflectors etc.
This is simply a helper method that calls ReflectionObject::createFromInstance().
Throws
Overriden by
|
#
|
public
|
getShortName(): 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").
Overriden 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").
Overriden by
Implements
|
#
|
public
|
getNamespaceName(): ?string
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").
Overriden 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…
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.
Overriden by
|
#
|
public
|
getExtensionName(): ?string
|
#
|
public
|
getMethods(int-mask-of<CoreReflectionMethod::IS_*> $filter = 0): array<non-empty-string, ReflectionMethod>
Fetch an array of all methods for this class.
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
Overriden by
|
#
|
public
|
getImmediateMethods(int-mask-of<CoreReflectionMethod::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.)
Overriden by
|
#
|
public
|
getMethod(non-empty-string $methodName): ?ReflectionMethod
Get a single method with the name $methodName.
Get a single method with the name $methodName.
Overriden by
|
#
|
public
|
hasMethod(non-empty-string $methodName): bool
Does the class have the specified method?
Does the class have the specified method?
Overriden by
|
#
|
public
|
getImmediateConstants(
int-mask-of<ReflectionClassConstantAdapter::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.),…
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 {@see ReflectionClassConstant} objects.
Returns
Overriden by
|
#
|
public
|
hasConstant(non-empty-string $name): bool
Does this class have the specified constant?
Does this class have the specified constant?
Overriden by
|
#
|
public
|
getConstant(non-empty-string $name): ?ReflectionClassConstant
Get the reflection object of the specified class constant.
Get the reflection object of the specified class constant.
Returns null if not specified.
Overriden by
|
#
|
public
|
getConstants(
int-mask-of<ReflectionClassConstantAdapter::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 {@see…
Get an associative array of the defined constants in this class,
with keys as constant names and values as {@see ReflectionClassConstant} objects.
Returns
Overriden by
|
#
|
public
|
getConstructor(): ?ReflectionMethod
Get the constructor method for this class.
Get the constructor method for this class.
Overriden by
|
#
|
public
|
getImmediateProperties(
int-mask-of<ReflectionPropertyAdapter::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.)
Overriden by
|
#
|
public
|
getProperties(int-mask-of<ReflectionPropertyAdapter::IS_*> $filter = 0): array<non-empty-string, ReflectionProperty>
Get the properties for this class.
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
Overriden by
|
#
|
public
|
getProperty(non-empty-string $name): ?ReflectionProperty
Get the property called $name.
Get the property called $name.
Returns null if property does not exist.
Overriden by
|
#
|
public
|
hasProperty(non-empty-string $name): bool
Does this class have the specified property?
Does this class have the specified property?
Overriden by
|
#
|
public
|
getDefaultProperties(): array<non-empty-string, scalar|array<scalar>|null>
|
#
|
public
|
getFileName(): ?string
|
#
|
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.
Overriden by
|
#
|
public
|
getEndLine(): positive-int
Get the line number that this class ends on.
Get the line number that this class ends on.
Overriden by
|
#
|
public
|
getStartColumn(): positive-int
|
#
|
public
|
getEndColumn(): positive-int
|
#
|
public
|
getParentClass(): ?ReflectionClass
Get the parent class, if it is defined. If this class does not have a
specified parent class, this will throw an…
Get the parent class, if it is defined. If this class does not have a
specified parent class, this will throw an exception.
Throws
Overriden 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.
Overriden by
|
#
|
public
|
getDocComment(): ?string
|
#
|
public
|
isAnonymous(): bool
|
#
|
public
|
isInternal(): bool
Is this an internal class?
Is this an internal class?
Overriden 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).
Overriden by
|
#
|
public
|
isDeprecated(): bool
|
#
|
public
|
isAbstract(): bool
Is this class an abstract class.
Is this class an abstract class.
Overriden by
|
#
|
public
|
isFinal(): bool
Is this class a final class.
Is this class a final class.
Overriden by
|
#
|
public
|
isReadOnly(): bool
|
#
|
public
|
getModifiers(): int-mask-of<ReflectionClassAdapter::IS_*>
Get the core-reflection-compatible modifier values.
Get the core-reflection-compatible modifier values.
Overriden by
|
#
|
public
|
isTrait(): bool
Is this reflection a trait?
Is this reflection a trait?
Overriden by
|
#
|
public
|
isInterface(): bool
Is this reflection an interface?
Is this reflection an interface?
Overriden 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…
Get the traits used, if any are defined. If this class does not have any
defined traits, this will return an empty array.
Overriden by
|
#
|
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…
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.
Overriden 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…
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'
Overriden by
|
#
|
public
|
getInterfaces(): array<class-string, self>
Gets the interfaces.
Returns
An associative array of interfaces, with keys as interface names and the array
values as {@see ReflectionClass} objects.
Overriden 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.)
Overriden by
|
#
|
public
|
getInterfaceNames(): list<class-string>
Gets the interface names.
Gets the interface names.
Returns
A numerical array with interface names as the values.
Overriden by
|
#
|
public
|
isInstance(object $object): bool
Checks whether the given object is an instance.
Checks whether the given object is an instance.
Overriden 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.
Overriden by
|
#
|
public
|
implementsInterface(string $interfaceName): bool
Checks whether this class implements the given interface.
Checks whether this class implements the given interface.
Overriden by
|
#
|
public
|
isInstantiable(): bool
Checks whether this reflection is an instantiable class
Checks whether this reflection is an instantiable class
Overriden 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
Overriden by
|
#
|
public
|
isIterateable(): bool
Checks if iterateable
|
#
|
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…
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
Overriden 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
Overriden 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>
|
#
|