PHP Class Swagger\Analysis

Show file Open project: zircote/swagger-php Class Usage Examples

Public Properties

Property Type Description
$annotations SplObjectStorage
$classes array Class definitions
$swagger Swagger\Annotations\Swagger The target Swagger annotation.

Public Methods

Method Description
__construct ( array $annotations = [], null $context = null )
addAnalysis ( Analysis $analysis )
addAnnotation ( AbstractAnnotation $annotation, Context $context )
addAnnotations ( array $annotations, Context $context )
addClassDefinition ( array $definition )
getAnnotationsOfType ( string $class, boolean $strict = false ) : array
getContext ( object $annotation ) : Context
getSubClasses ( $class )
getSuperClasses ( $class )
merged ( ) : Analysis Build an analysis with only the annotations that are merged into the swagger annotation.
process ( Closur\Closure | Closur\Closure[] $processors = null ) Apply the processor(s)
processors ( ) : array Get direct access to the processors array.
registerProcessor ( Closure $processor ) Register a processor
split ( ) : object Split the annotation into two analysis.
unmerged ( ) : Analysis Analysis with only the annotations that not merged.
unregisterProcessor ( Closure $processor ) Unregister a processor
validate ( )

Method Details

__construct() public method

public __construct ( array $annotations = [], null $context = null )
$annotations array
$context null

addAnalysis() public method

public addAnalysis ( Analysis $analysis )
$analysis Analysis

addAnnotation() public method

public addAnnotation ( AbstractAnnotation $annotation, Context $context )
$annotation Swagger\Annotations\AbstractAnnotation
$context Context

addAnnotations() public method

public addAnnotations ( array $annotations, Context $context )
$annotations array
$context Context

addClassDefinition() public method

public addClassDefinition ( array $definition )
$definition array

getAnnotationsOfType() public method

public getAnnotationsOfType ( string $class, boolean $strict = false ) : array
$class string
$strict boolean Innon-strict mode childclasses are also detected.
return array

getContext() public method

public getContext ( object $annotation ) : Context
$annotation object
return Context

getSubClasses() public method

public getSubClasses ( $class )

getSuperClasses() public method

public getSuperClasses ( $class )

merged() public method

Build an analysis with only the annotations that are merged into the swagger annotation.
public merged ( ) : Analysis
return Analysis

process() public method

Apply the processor(s)
public process ( Closur\Closure | Closur\Closure[] $processors = null )
$processors Closur\Closure | Closur\Closure[] One or more processors

processors() public static method

Get direct access to the processors array.
public static processors ( ) : array
return array reference

registerProcessor() public static method

Register a processor
public static registerProcessor ( Closure $processor )
$processor Closure

split() public method

One with annotations that are merged and one with annotations that are not merged.
public split ( ) : object
return object {merged: Analysis, unmerged: Analysis}

unmerged() public method

Analysis with only the annotations that not merged.
public unmerged ( ) : Analysis
return Analysis

unregisterProcessor() public static method

Unregister a processor
public static unregisterProcessor ( Closure $processor )
$processor Closure

validate() public method

public validate ( )

Property Details

$annotations public property

public SplObjectStorage $annotations
return SplObjectStorage

$classes public property

Class definitions
public array $classes
return array

$swagger public property

The target Swagger annotation.
public Swagger,Swagger\Annotations $swagger
return Swagger\Annotations\Swagger