PHP Class Swagger\Annotations\AbstractAnnotation

Inheritance: implements JsonSerializabl\JsonSerializable
Afficher le fichier Open project: zircote/swagger-php Class Usage Examples

Méthodes publiques

Свойство Type Description
$_blacklist array List of properties are blacklisted from the JSON output.
$_context Swagger\Context
$_nested array Examples: 'Swagger\Annotation\Info' => 'info', // Set @SWG\Info annotation as the info property. 'Swagger\Annotation\Parameter' => ['parameters'], // Append @SWG\Parameter annotations the parameters array. 'Swagger\Annotation\Path' => ['paths', 'path'], // Append @SWG\Path annotations the paths array and use path as key.
$_parents string[] Reverse mapping of $_nested with the allowed parent annotations.
$_required array The properties which are required by the spec
$_types array Examples: 'name' => 'string' // a string 'required' => 'boolean', // true or false 'tags' => '[string]', // array containing strings 'in' => ["query", "header", "path", "formData", "body"] // must be one on these
$_unmerged array Annotations that couldn't be merged by mapping or postprocessing.
$x array The keys inside the array will be prefixed with x-. For further details see https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#vendorExtensions.

Méthodes publiques

Méthode Description
__construct ( array $properties )
__debugInfo ( )
__get ( $property )
__set ( $property, $value )
__toString ( )
identity ( ) : string Return a identity for easy debugging.
jsonSerialize ( ) : array Customize the way json_encode() renders the annotations.
merge ( AbstractAnnotation[] $annotations, boolean $ignore = false ) : AbstractAnnotation[] Merge given annotations to their mapped properties configured in static::$_nested.
mergeProperties ( object $object ) Merge the properties from the given object into this annotation.
validate ( array $parents = [], array $skip = [] ) : boolean Validate annotation tree, and log notices & warnings.

Méthodes protégées

Méthode Description
_identity ( array $properties ) : string Helper for generating the identity()

Private Methods

Méthode Description
_validate ( array | object $fields, array $path, $skip ) : boolean Recursively validate all annotation properties.
nested ( AbstractAnnotation $annotation, Context $nestedContext ) : AbstractAnnotation Wrap the context with a reference to the annotation it is nested in.
validateType ( $type, $value )

Method Details

__construct() public méthode

public __construct ( array $properties )
$properties array

__debugInfo() public méthode

public __debugInfo ( )

__get() public méthode

public __get ( $property )

__set() public méthode

public __set ( $property, $value )

__toString() public méthode

public __toString ( )

_identity() protected méthode

Helper for generating the identity()
protected _identity ( array $properties ) : string
$properties array
Résultat string

identity() public méthode

Example: "@SWG\Get(path="/pets")"
public identity ( ) : string
Résultat string

jsonSerialize() public méthode

Customize the way json_encode() renders the annotations.
public jsonSerialize ( ) : array
Résultat array

merge() public méthode

Annotations that couldn't be merged are added to the _unmerged array.
public merge ( AbstractAnnotation[] $annotations, boolean $ignore = false ) : AbstractAnnotation[]
$annotations AbstractAnnotation[]
$ignore boolean Ignore unmerged annotations
Résultat AbstractAnnotation[] The unmerged annotations

mergeProperties() public méthode

Prevents overwriting properties that are already configured.
public mergeProperties ( object $object )
$object object

validate() public méthode

Validate annotation tree, and log notices & warnings.
public validate ( array $parents = [], array $skip = [] ) : boolean
$parents array The path of annotations above this annotation in the tree.
$skip array (prevent stack overflow, when traversing an infinite dependency graph)
Résultat boolean

Property Details

$_blacklist public_oe static_oe property

List of properties are blacklisted from the JSON output.
public static array $_blacklist
Résultat array

$_context public_oe property

public Context,Swagger $_context
Résultat Swagger\Context

$_nested public_oe static_oe property

Examples: 'Swagger\Annotation\Info' => 'info', // Set @SWG\Info annotation as the info property. 'Swagger\Annotation\Parameter' => ['parameters'], // Append @SWG\Parameter annotations the parameters array. 'Swagger\Annotation\Path' => ['paths', 'path'], // Append @SWG\Path annotations the paths array and use path as key.
public static array $_nested
Résultat array

$_parents public_oe static_oe property

Reverse mapping of $_nested with the allowed parent annotations.
public static string[] $_parents
Résultat string[]

$_required public_oe static_oe property

The properties which are required by the spec
public static array $_required
Résultat array

$_types public_oe static_oe property

Examples: 'name' => 'string' // a string 'required' => 'boolean', // true or false 'tags' => '[string]', // array containing strings 'in' => ["query", "header", "path", "formData", "body"] // must be one on these
public static array $_types
Résultat array

$_unmerged public_oe property

Annotations that couldn't be merged by mapping or postprocessing.
public array $_unmerged
Résultat array

$x public_oe property

The keys inside the array will be prefixed with x-. For further details see https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#vendorExtensions.
public array $x
Résultat array