PHP Class Swagger\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
Show file Open project: zircote/swagger-php Class Usage Examples

Public Methods

Method Description
__construct ( array $properties = [], Context $parent = null )
__debugInfo ( )
__get ( string $property ) : mixed Traverse the context tree to get the property value.
__toString ( )
detect ( integer $index ) : Context Create a Context based on the debug_backtrace
fullyQualifiedName ( string $class ) : string Resolve the fully qualified name.
getDebugLocation ( ) : string Export location for debugging.
getRootContext ( ) : Context
is ( string $type ) : boolean Check if a property is set directly on this context and not its parent context.
not ( string $type ) : boolean Check if a property is NOT set directly on this context and but its parent context.
phpdocContent ( ) : string | null The text contents of the phpdoc comment (excl. tags)
phpdocDescription ( ) : string | null 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 | null A short piece of text, usually one line, providing the basic function of the associated element.
with ( string $property ) : boolean | Context Return the context containing the specified property.

Method Details

__construct() public method

public __construct ( array $properties = [], Context $parent = null )
$properties array new properties for this context.
$parent Context The parent context

__debugInfo() public method

public __debugInfo ( )

__get() public method

Traverse the context tree to get the property value.
public __get ( string $property ) : mixed
$property string
return mixed

__toString() public method

public __toString ( )

detect() public static method

Create a Context based on the debug_backtrace
public static detect ( integer $index ) : Context
$index integer
return Context

fullyQualifiedName() public method

Resolve the fully qualified name.
public fullyQualifiedName ( string $class ) : string
$class string The class name
return string

getDebugLocation() public method

Export location for debugging.
public getDebugLocation ( ) : string
return string Example: "file1.php on line 12"

getRootContext() public method

public getRootContext ( ) : Context
return Context

is() public method

Check if a property is set directly on this context and not its parent context.
public is ( string $type ) : boolean
$type string Example: $c->is('method') or $c->is('class')
return boolean

not() public method

Check if a property is NOT set directly on this context and but its parent context.
public not ( string $type ) : boolean
$type string Example: $c->not('method') or $c->not('class')
return boolean

phpdocContent() public method

The text contents of the phpdoc comment (excl. tags)
public phpdocContent ( ) : string | null
return string | null

phpdocDescription() public method

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 | null
return string | null

phpdocSummary() public method

A short piece of text, usually one line, providing the basic function of the associated element.
public phpdocSummary ( ) : string | null
return string | null

with() public method

Return the context containing the specified property.
public with ( string $property ) : boolean | Context
$property string
return boolean | Context