class StaticReflectionParser implements ReflectionProviderInterface (View source)

Parses a file for namespaces/use/class declarations.

Properties

protected string $className The name of the class.
protected boolean. $classAnnotationOptimize TRUE if the caller only wants class annotations.
protected boolean $parsed TRUE when the parser has ran.
protected string $namespace The namespace of the class
protected array $useStatements The use statements of this class.
protected string $docComment The docComment of the class.
protected string $parentClassName The name of the class this class extends, if any.
protected StaticReflectionParser $parentStaticReflectionParser The parent PSR-0 Parser.

Methods

__construct($className, $finder, $classAnnotationOptimize = false)

Parses a class residing in a PSR-0 hierarchy.

parse()

No description

getClassName()

No description

getNamespaceName()

No description

ReflectionClass
getReflectionClass()

Get the ReflectionClass equivalent for this file / class.

ReflectionMethod
getReflectionMethod($methodName)

Get the ReflectionMethod equivalent for the method of this file / class.

ReflectionMethod
getReflectionProperty($propertyName)

Get the ReflectionProperty equivalent for the method of this file / class.

getUseStatements()

Get the use statements from this file.

string
getDocComment(string $type = 'class', string $name = '')

Get docComment.

getStaticReflectionParserForDeclaringClass(string $type, string $name)

Get the PSR-0 parser for the declaring class.

Details

__construct($className, $finder, $classAnnotationOptimize = false)

Parses a class residing in a PSR-0 hierarchy.

Parameters

$className
$finder
$classAnnotationOptimize

protected parse()

protected getParentStaticReflectionParser()

getClassName()

getNamespaceName()

ReflectionClass getReflectionClass()

Get the ReflectionClass equivalent for this file / class.

Return Value

ReflectionClass

ReflectionMethod getReflectionMethod($methodName)

Get the ReflectionMethod equivalent for the method of this file / class.

Parameters

$methodName

Return Value

ReflectionMethod

ReflectionMethod getReflectionProperty($propertyName)

Get the ReflectionProperty equivalent for the method of this file / class.

Parameters

$propertyName

Return Value

ReflectionMethod

getUseStatements()

Get the use statements from this file.

string getDocComment(string $type = 'class', string $name = '')

Get docComment.

Parameters

string $type class, property or method.
string $name Name of the property or method, not needed for class.

Return Value

string the doc comment or empty string if none.

StaticReflectionParser getStaticReflectionParserForDeclaringClass(string $type, string $name)

Get the PSR-0 parser for the declaring class.

Parameters

string $type property or method.
string $name Name of the property or method.

Return Value

StaticReflectionParser A static reflection parser for the declaring class.