Properties

$defaultNamespace

$defaultNamespace : string

Stores the default namespace for Objects instance, usually used on methods like getMethodAnnotationsObjects()

Type

string

$annotationCache

$annotationCache : array

静态数组来存储已经解析注解

Type

array

$classAnnotationCache

$classAnnotationCache : 

Type

$classMethodAnnotationCache

$classMethodAnnotationCache : 

Type

$classPropertyValueCache

$classPropertyValueCache : 

Type

$strict

$strict : boolean

Indicates that annotations should has strict behavior, 'false' by default

Type

boolean

Methods

setStrict()

setStrict(boolean  $value) 

严格的变量设置为true / false

Parameters

boolean $value

boolean value to indicate that annotations to has strict behavior

setDefaultNamespace()

setDefaultNamespace(string  $namespace) 

Sets default namespace to use in object instantiation

Parameters

string $namespace

default namespace

getDefaultAnnotationNamespace()

getDefaultAnnotationNamespace() : string

Gets default namespace used in object instantiation

Returns

string —

$namespace default namespace

getClassAnnotations()

getClassAnnotations(string  $className) : array

Gets all anotations with pattern @SomeAnnotation() from a given class

Parameters

string $className

class name to get annotations

Returns

array —

self::$classAnnotationCache all annotated elements

getClassMethodAnnotations()

getClassMethodAnnotations(  $className) : mixed

获取类所有方法的属性配置

Parameters

$className

Throws

\ReflectionException

Returns

mixed

getClassPropertyValues()

getClassPropertyValues(  $className) 

Parameters

$className

getAllClassAnnotations()

getAllClassAnnotations() 

getAllClassMethodAnnotations()

getAllClassMethodAnnotations() 

getAllClassPropertyValues()

getAllClassPropertyValues() 

getClassPropertyValue()

getClassPropertyValue(  $className,   $property) 

Parameters

$className
$property

getMethodAnnotations()

getMethodAnnotations(string  $className, string  $methodName) : array

Gets all anotations with pattern @SomeAnnotation() from a determinated method of a given class

Parameters

string $className

class name

string $methodName

method name to get annotations

Returns

array —

self::$annotationCache all annotated elements of a method given

getMethodAnnotationsObjects()

getMethodAnnotationsObjects(string  $className, string  $methodName) : array

Gets all anotations with pattern @SomeAnnotation() from a determinated method of a given class and instance its abcAnnotation class

Parameters

string $className

class name

string $methodName

method name to get annotations

Returns

array —

self::$annotationCache all annotated objects of a method given

consolidateAnnotations()

consolidateAnnotations(  $method,   $class) 

Parameters

$method
$class

parseCustomAnnotations()

parseCustomAnnotations(string  $docblock, string  $name = 'param') : array

Parse annotations

Parameters

string $docblock
string $name

Returns

array —

parsed annotations params

parseAnnotations()

parseAnnotations(string  $docblock) : array

Parse annotations

Parameters

string $docblock

Returns

array —

parsed annotations params

parseArgs()

parseArgs(string  $content) : array

Parse individual annotation arguments

Parameters

string $content

arguments string

Returns

array —

annotated arguments

castValue()

castValue(string  $val, boolean  $trim = false) : mixed

Try determinate the original type variable of a string

Parameters

string $val

string containing possibles variables that can be cast to bool or int

boolean $trim

indicate if the value passed should be trimmed after to try cast

Returns

mixed —

returns the value converted to original type if was possible