StaticReflectionParser
in package
implements
ReflectionProviderInterface
Parses a file for namespaces/use/class declarations.
Tags
Interfaces, Classes and Traits
Table of Contents
- $classAnnotationOptimize : mixed
- Whether the caller only wants class annotations.
- $className : string
- The fully qualified class name.
- $docComment : string
- The docComment of the class.
- $namespace : string
- The namespace of the class.
- $parentClassName : string
- The name of the class this class extends, if any.
- $parentStaticReflectionParser : StaticReflectionParser
- The parent PSR-0 Parser.
- $parsed : bool
- Whether the parser has run.
- $shortClassName : string
- The short class name.
- $useStatements : array<string|int, mixed>
- The use statements of the class.
- __construct() : mixed
- Parses a class residing in a PSR-0 hierarchy.
- getClassName() : string
- getDocComment() : string
- Gets the doc comment.
- getNamespaceName() : string
- getReflectionClass() : ReflectionClass
- Gets the ReflectionClass equivalent for this class.
- getReflectionMethod() : ReflectionMethod
- Gets the ReflectionMethod equivalent for this class.
- getReflectionProperty() : ReflectionProperty
- Gets the ReflectionProperty equivalent for this class.
- getStaticReflectionParserForDeclaringClass() : StaticReflectionParser
- Gets the PSR-0 parser for the declaring class.
- getUseStatements() : array<string|int, mixed>
- Gets the use statements from this file.
- getParentStaticReflectionParser() : StaticReflectionParser
- parse() : void
Properties
$classAnnotationOptimize
Whether the caller only wants class annotations.
protected
mixed
$classAnnotationOptimize
boolean.
$className
The fully qualified class name.
protected
string
$className
$docComment
The docComment of the class.
protected
string
$docComment
= ['class' => '', 'property' => [], 'method' => []]
$namespace
The namespace of the class.
protected
string
$namespace
= ''
$parentClassName
The name of the class this class extends, if any.
protected
string
$parentClassName
= ''
$parentStaticReflectionParser
The parent PSR-0 Parser.
protected
StaticReflectionParser
$parentStaticReflectionParser
$parsed
Whether the parser has run.
protected
bool
$parsed
= false
$shortClassName
The short class name.
protected
string
$shortClassName
$useStatements
The use statements of the class.
protected
array<string|int, mixed>
$useStatements
= []
Methods
__construct()
Parses a class residing in a PSR-0 hierarchy.
public
__construct(string $className, ClassFinderInterface $finder[, bool $classAnnotationOptimize = false ]) : mixed
Parameters
- $className : string
-
The full, namespaced class name.
- $finder : ClassFinderInterface
-
A ClassFinder object which finds the class.
- $classAnnotationOptimize : bool = false
-
Only retrieve the class docComment. Presumes there is only one statement per line.
Return values
mixed —getClassName()
public
getClassName() : string
Return values
string —getDocComment()
Gets the doc comment.
public
getDocComment([string $type = 'class' ][, string $name = '' ]) : string
Parameters
- $type : string = 'class'
-
The type: 'class', 'property' or 'method'.
- $name : string = ''
-
The name of the property or method, not needed for 'class'.
Return values
string —The doc comment, empty string if none.
getNamespaceName()
public
getNamespaceName() : string
Return values
string —getReflectionClass()
Gets the ReflectionClass equivalent for this class.
public
getReflectionClass() : ReflectionClass
Return values
ReflectionClass —getReflectionMethod()
Gets the ReflectionMethod equivalent for this class.
public
getReflectionMethod(mixed $methodName) : ReflectionMethod
Parameters
- $methodName : mixed
Return values
ReflectionMethod —getReflectionProperty()
Gets the ReflectionProperty equivalent for this class.
public
getReflectionProperty(mixed $propertyName) : ReflectionProperty
Parameters
- $propertyName : mixed
Return values
ReflectionProperty —getStaticReflectionParserForDeclaringClass()
Gets the PSR-0 parser for the declaring class.
public
getStaticReflectionParserForDeclaringClass(string $type, string $name) : StaticReflectionParser
Parameters
- $type : string
-
The type: 'property' or 'method'.
- $name : string
-
The name of the property or method.
Tags
Return values
StaticReflectionParser —A static reflection parser for the declaring class.
getUseStatements()
Gets the use statements from this file.
public
getUseStatements() : array<string|int, mixed>
Return values
array<string|int, mixed> —getParentStaticReflectionParser()
protected
getParentStaticReflectionParser() : StaticReflectionParser
Return values
StaticReflectionParser —parse()
protected
parse() : void