ClassReflection
extends ReflectionClass
in package
implements
ReflectionInterface
Interfaces, Classes, Traits and Enums
Table of Contents
- $annotations : AnnotationScanner
- $docBlock : DocBlockReflection
- __toString() : string
- getAnnotations() : AnnotationCollection|false
- getContents() : string
- Return the contents of the class
- getDeclaringFile() : FileReflection
- Return the reflection file of the declaring file.
- getDocBlock() : DocBlockReflection|false
- Return the classes DocBlock reflection object
- getInterfaces() : array<string|int, ClassReflection>
- Get all reflection objects of implemented interfaces
- getMethod() : MethodReflection
- Return method reflection by name
- getMethods() : array<string|int, MethodReflection>
- Get reflection objects of all methods
- getParentClass() : ClassReflection|bool
- Get parent reflection class of reflected class
- getProperties() : array<string|int, PropertyReflection>
- Return reflection properties of this class
- getProperty() : PropertyReflection
- Return reflection property of this class by name
- getStartLine() : int
- Return the start line of the class
- getTraits() : null|array<string|int, mixed>
- Returns an array of reflection classes of traits used by this class.
- toString() : string
- createFileScanner() : FileScanner
- Creates a new FileScanner instance.
Properties
$annotations
protected
AnnotationScanner
$annotations
$docBlock
protected
DocBlockReflection
$docBlock
Methods
__toString()
public
__toString() : string
Return values
string —getAnnotations()
public
getAnnotations(AnnotationManager $annotationManager) : AnnotationCollection|false
Parameters
- $annotationManager : AnnotationManager
Return values
AnnotationCollection|false —getContents()
Return the contents of the class
public
getContents([bool $includeDocBlock = true ]) : string
Parameters
- $includeDocBlock : bool = true
Return values
string —getDeclaringFile()
Return the reflection file of the declaring file.
public
getDeclaringFile() : FileReflection
Return values
FileReflection —getDocBlock()
Return the classes DocBlock reflection object
public
getDocBlock() : DocBlockReflection|false
Tags
Return values
DocBlockReflection|false —getInterfaces()
Get all reflection objects of implemented interfaces
public
getInterfaces() : array<string|int, ClassReflection>
Return values
array<string|int, ClassReflection> —getMethod()
Return method reflection by name
public
getMethod(string $name) : MethodReflection
Parameters
- $name : string
Return values
MethodReflection —getMethods()
Get reflection objects of all methods
public
getMethods([int $filter = -1 ]) : array<string|int, MethodReflection>
Parameters
- $filter : int = -1
Return values
array<string|int, MethodReflection> —getParentClass()
Get parent reflection class of reflected class
public
getParentClass() : ClassReflection|bool
Return values
ClassReflection|bool —getProperties()
Return reflection properties of this class
public
getProperties([int $filter = -1 ]) : array<string|int, PropertyReflection>
Parameters
- $filter : int = -1
Return values
array<string|int, PropertyReflection> —getProperty()
Return reflection property of this class by name
public
getProperty(string $name) : PropertyReflection
Parameters
- $name : string
Return values
PropertyReflection —getStartLine()
Return the start line of the class
public
getStartLine([bool $includeDocComment = false ]) : int
Parameters
- $includeDocComment : bool = false
Return values
int —getTraits()
Returns an array of reflection classes of traits used by this class.
public
getTraits() : null|array<string|int, mixed>
Return values
null|array<string|int, mixed> —toString()
public
toString() : string
Return values
string —createFileScanner()
Creates a new FileScanner instance.
protected
createFileScanner(string $filename) : FileScanner
By having this as a separate method it allows the method to be overridden if a different FileScanner is needed.
Parameters
- $filename : string