Documentation

Context
in package

Context.

The context in which the annotation is parsed. It includes useful metadata which the Processors can use to augment the annotations.

Context hierarchy:

  • parseContext |- docBlockContext |- classContext |- docBlockContext |- propertyContext |- methodContext

Table of Contents

$annotations  : array<string|int, AbstractAnnotation>
$character  : int
$class  : string
$comment  : string
$extends  : array<string|int, mixed>|string
$filename  : string
$generated  : bool
$implements  : array<string|int, mixed>
$interface  : string
$line  : int
$logger  : LoggerInterface
$method  : string
$namespace  : string
$nested  : AbstractAnnotation
$nullable  : bool
$property  : string
$static  : bool
$trait  : string
$type  : string
$uses  : array<string|int, mixed>
$_parent  : Context
Prototypical inheritance for properties.
__construct()  : mixed
__debugInfo()  : mixed
__get()  : mixed
Traverse the context tree to get the property value.
__toString()  : mixed
detect()  : Context
Create a Context based on the debug_backtrace.
fullyQualifiedName()  : string
Resolve the fully qualified name.
getDebugLocation()  : string
Export location for debugging.
getRootContext()  : Context
is()  : bool
Check if a property is set directly on this context and not its parent context.
not()  : bool
Check if a property is NOT set directly on this context and but its parent context.
phpdocContent()  : string
The text contents of the phpdoc comment (excl. tags).
phpdocDescription()  : string
An optional longer piece of text providing more details on the associated element’s function. This is very useful when working with a complex element.
phpdocSummary()  : string
A short piece of text, usually one line, providing the basic function of the associated element.
with()  : Context|null
Return the context containing the specified property.

Properties

$comment

public string $comment

The PHP DocComment

$extends

public array<string|int, mixed>|string $extends

Interfaces may extend a list of interfaces

$generated

public bool $generated

Indicate the context was generated by a processor or the serializer

$implements

public array<string|int, mixed> $implements

$nullable

public bool $nullable

Indicate a nullable value

$static

public bool $static

Indicate a static method

$uses

public array<string|int, mixed> $uses

$_parent

Prototypical inheritance for properties.

private Context $_parent

Methods

__construct()

public __construct([array<string|int, mixed> $properties = [] ][, Context $parent = null ]) : mixed
Parameters
$properties : array<string|int, mixed> = []

new properties for this context

$parent : Context = null

The parent context

Return values
mixed

__debugInfo()

public __debugInfo() : mixed
Return values
mixed

__get()

Traverse the context tree to get the property value.

public __get(string $property) : mixed
Parameters
$property : string
Return values
mixed

__toString()

public __toString() : mixed
Return values
mixed

detect()

Create a Context based on the debug_backtrace.

public static detect(int $index) : Context
Parameters
$index : int
Tags
deprecated
Return values
Context

fullyQualifiedName()

Resolve the fully qualified name.

public fullyQualifiedName(string $source) : string
Parameters
$source : string

The source name (class/interface/trait)

Return values
string

getDebugLocation()

Export location for debugging.

public getDebugLocation() : string
Return values
string

Example: "file1.php on line 12"

is()

Check if a property is set directly on this context and not its parent context.

public is(string $type) : bool
Parameters
$type : string

Example: $c->is('method') or $c->is('class')

Return values
bool

not()

Check if a property is NOT set directly on this context and but its parent context.

public not(string $type) : bool
Parameters
$type : string

Example: $c->not('method') or $c->not('class')

Return values
bool

phpdocContent()

The text contents of the phpdoc comment (excl. tags).

public phpdocContent() : string
Return values
string

phpdocDescription()

An optional longer piece of text providing more details on the associated element’s function. This is very useful when working with a complex element.

public phpdocDescription() : string
Return values
string

phpdocSummary()

A short piece of text, usually one line, providing the basic function of the associated element.

public phpdocSummary() : string
Return values
string

with()

Return the context containing the specified property.

public with(string $property) : Context|null
Parameters
$property : string
Return values
Context|null

Search results