PHP Class Scalr\Tests\Functional\Api\V2\SpecSchema\SpecManager

Since: 5.6.14 (03.12.2015)
Author: Andrii Penchuk ([email protected])
Afficher le fichier Open project: scalr/scalr Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( string $version, string $service ) SpecManager constructor.
getDefinitions ( string $filter = null ) : array Get Object definition
getPathParameters ( string $path ) : array Return endpoint parameters
getPathTemplates ( string $method = null ) : string[] The list of endpoints in Api specifications
getResponse ( string $path, string $method, integer $httpCode ) : DetailsResponse | ListResponse Get Response definitions with Api endpoint

Méthodes protégées

Méthode Description
checkPath ( string $path ) Check if path not exist, will throw exception
getPath ( variadic $segments ) : array Return Api definitions from segment
resolveReferences ( array $schema, mixed $specObject = null, mixed $objectName = null ) : DetailsResponse | ListResponse Resolve schema references to object

Method Details

__construct() public méthode

SpecManager constructor.
public __construct ( string $version, string $service )
$version string Api version
$service string spec file service

checkPath() protected méthode

Check if path not exist, will throw exception
protected checkPath ( string $path )
$path string path in Api specifications

getDefinitions() public méthode

Get Object definition
public getDefinitions ( string $filter = null ) : array
$filter string optional The pattern to filter for object definition in specification if the name of the object matched the filter this object will not be included in return result
Résultat array

getPath() protected méthode

Return Api definitions from segment
protected getPath ( variadic $segments ) : array
$segments variadic patch segments
Résultat array

getPathParameters() public méthode

Return endpoint parameters
public getPathParameters ( string $path ) : array
$path string Api endpoint
Résultat array

getPathTemplates() public méthode

The list of endpoints in Api specifications
public getPathTemplates ( string $method = null ) : string[]
$method string HTTP method
Résultat string[]

getResponse() public méthode

Get Response definitions with Api endpoint
public getResponse ( string $path, string $method, integer $httpCode ) : DetailsResponse | ListResponse
$path string Api endpoint
$method string HTTP method
$httpCode integer HTTP code
Résultat Scalr\Tests\Functional\Api\V2\SpecSchema\DataTypes\DetailsResponse | Scalr\Tests\Functional\Api\V2\SpecSchema\DataTypes\ListResponse

resolveReferences() protected méthode

Resolve schema references to object
protected resolveReferences ( array $schema, mixed $specObject = null, mixed $objectName = null ) : DetailsResponse | ListResponse
$schema array segment Api specifications
$specObject mixed optional object schema view
$objectName mixed optional object property name
Résultat Scalr\Tests\Functional\Api\V2\SpecSchema\DataTypes\DetailsResponse | Scalr\Tests\Functional\Api\V2\SpecSchema\DataTypes\ListResponse