Analysis
in package
Result of the analyser.
Pretends to be an array of annotations, but also contains detected classes and helper functions for the processors.
Table of Contents
- $annotations : SplObjectStorage
- $classes : array<string|int, mixed>
- Class definitions.
- $context : Context
- $interfaces : array<string|int, mixed>
- Interface definitions.
- $openapi : OpenApi
- The target OpenApi annotation.
- $traits : array<string|int, mixed>
- Trait definitions.
- $processors : array<string|int, callable>
- Registry for the post-processing operations.
- __construct() : mixed
- addAnalysis() : void
- addAnnotation() : void
- addAnnotations() : void
- addClassDefinition() : void
- addInterfaceDefinition() : void
- addTraitDefinition() : void
- getAnnotationsOfType() : array<string|int, AbstractAnnotation>
- getContext() : Context
- getInterfacesOfClass() : array<string|int, mixed>
- Get the list of interfaces used by the given class or by classes which it extends.
- getSchemaForSource() : Schema|null
- getSubClasses() : array<string|int, mixed>
- Get all sub classes of the given parent class.
- getSuperClasses() : array<string|int, mixed>
- Get a list of all super classes for the given class.
- getTraitsOfClass() : array<string|int, mixed>
- Get the list of traits used by the given class/trait or by classes which it extends.
- merged() : Analysis
- Build an analysis with only the annotations that are merged into the OpenAPI annotation.
- process() : void
- Apply the processor(s).
- processors() : array<string|int, mixed>
- Get direct access to the processors array.
- registerProcessor() : void
- Register a processor.
- split() : object
- Split the annotation into two analysis.
- unmerged() : Analysis
- Analysis with only the annotations that not merged.
- unregisterProcessor() : void
- Unregister a processor.
- validate() : bool
Properties
$annotations
public
SplObjectStorage
$annotations
$classes
Class definitions.
public
array<string|int, mixed>
$classes
= []
$context
public
Context
$context
$interfaces
Interface definitions.
public
array<string|int, mixed>
$interfaces
= []
$openapi
The target OpenApi annotation.
public
OpenApi
$openapi
$traits
Trait definitions.
public
array<string|int, mixed>
$traits
= []
$processors
Registry for the post-processing operations.
private
static array<string|int, callable>
$processors
Methods
__construct()
public
__construct([array<string|int, mixed> $annotations = [] ][, Context $context = null ]) : mixed
Parameters
- $annotations : array<string|int, mixed> = []
- $context : Context = null
Return values
mixed —addAnalysis()
public
addAnalysis(Analysis $analysis) : void
Parameters
- $analysis : Analysis
Return values
void —addAnnotation()
public
addAnnotation(mixed $annotation, Context|null $context) : void
Parameters
- $annotation : mixed
- $context : Context|null
Return values
void —addAnnotations()
public
addAnnotations(array<string|int, mixed> $annotations, Context|null $context) : void
Parameters
- $annotations : array<string|int, mixed>
- $context : Context|null
Return values
void —addClassDefinition()
public
addClassDefinition(array<string|int, mixed> $definition) : void
Parameters
- $definition : array<string|int, mixed>
Return values
void —addInterfaceDefinition()
public
addInterfaceDefinition(array<string|int, mixed> $definition) : void
Parameters
- $definition : array<string|int, mixed>
Return values
void —addTraitDefinition()
public
addTraitDefinition(array<string|int, mixed> $definition) : void
Parameters
- $definition : array<string|int, mixed>
Return values
void —getAnnotationsOfType()
public
getAnnotationsOfType(string $class[, bool $strict = false ]) : array<string|int, AbstractAnnotation>
Parameters
- $class : string
- $strict : bool = false
-
in non-strict mode child classes are also detected
Return values
array<string|int, AbstractAnnotation> —getContext()
public
getContext(object $annotation) : Context
Parameters
- $annotation : object
Return values
Context —getInterfacesOfClass()
Get the list of interfaces used by the given class or by classes which it extends.
public
getInterfacesOfClass(string $class[, bool $direct = false ]) : array<string|int, mixed>
Parameters
- $class : string
-
the class name
- $direct : bool = false
-
flag to find only the actual class interfaces
Return values
array<string|int, mixed> —map of class => definition pairs of interfaces
getSchemaForSource()
public
getSchemaForSource(string $fqdn) : Schema|null
Parameters
- $fqdn : string
-
the source class/interface/trait
Return values
Schema|null —getSubClasses()
Get all sub classes of the given parent class.
public
getSubClasses(string $parent) : array<string|int, mixed>
Parameters
- $parent : string
-
the parent class
Return values
array<string|int, mixed> —map of class => definition pairs of sub-classes
getSuperClasses()
Get a list of all super classes for the given class.
public
getSuperClasses(string $class[, bool $direct = false ]) : array<string|int, mixed>
Parameters
- $class : string
-
the class name
- $direct : bool = false
-
flag to find only the actual class parents
Return values
array<string|int, mixed> —map of class => definition pairs of parent classes
getTraitsOfClass()
Get the list of traits used by the given class/trait or by classes which it extends.
public
getTraitsOfClass(string $source[, bool $direct = false ]) : array<string|int, mixed>
Parameters
- $source : string
-
the source name
- $direct : bool = false
-
flag to find only the actual class traits
Return values
array<string|int, mixed> —map of class => definition pairs of traits
merged()
Build an analysis with only the annotations that are merged into the OpenAPI annotation.
public
merged() : Analysis
Return values
Analysis —process()
Apply the processor(s).
public
process([Closure|array<string|int, Closure> $processors = null ]) : void
Parameters
- $processors : Closure|array<string|int, Closure> = null
-
One or more processors
Return values
void —processors()
Get direct access to the processors array.
public
static & processors() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —reference
registerProcessor()
Register a processor.
public
static registerProcessor(Closure $processor) : void
Parameters
- $processor : Closure
Tags
Return values
void —split()
Split the annotation into two analysis.
public
split() : object
One with annotations that are merged and one with annotations that are not merged.
Return values
object —{merged: Analysis, unmerged: Analysis}
unmerged()
Analysis with only the annotations that not merged.
public
unmerged() : Analysis
Return values
Analysis —unregisterProcessor()
Unregister a processor.
public
static unregisterProcessor(Closure $processor) : void
Parameters
- $processor : Closure
Tags
Return values
void —validate()
public
validate() : bool