PHP Класс Raml\Parser

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( array $schemaParsers = null, array $securitySettingsParsers = null, array $fileLoaders = null, raml\ParseConfiguration $config = null ) Create a new parser object - Optionally pass a list of parsers to use - If null is passed then the default schemaParsers are used
addFileLoader ( Raml\FileLoader\FileLoaderInterface $fileLoader ) Add a file loader
addSchemaParser ( Raml\Schema\SchemaParserInterface $schemaParser ) Add a new schema parser
addSecuritySettingParser ( Raml\SecurityScheme\SecuritySettingsParserInterface $securitySettingsParser ) Add a new security scheme
parse ( string $rawFileName ) : ApiDefinition Parse a RAML spec from a file
parseFromString ( string $ramlString, string $rootDir ) : ApiDefinition Parse a RAML spec from a string
setConfiguration ( raml\ParseConfiguration $config ) Set the parse configuration

Приватные методы

Метод Описание
applyTraitVariables ( array $values, array $trait ) : mixed Add trait variables
getCachedFilePath ( string $data ) : string
includeAndParseFiles ( array | string $structure, string $rootDir ) : array Recurse through the structure and load includes
loadAndParseFile ( string $fileName, string $rootDir ) : array Load and parse a file
parseRamlData ( string $ramlData, string $rootDir ) : ApiDefinition Parse RAML data
parseRamlString ( string $ramlString, string $rootDir ) : array Parse a RAML or YAML content
parseResourceTypes ( $ramlData ) : array Parse the resource types
parseSecuritySettings ( $schemesArray ) : array Parse the security settings data into an array
parseTraits ( $ramlData ) : array Parse the traits
parseYaml ( string $fileData ) : array Convert a yaml string into an array
recurseAndParseSchemas ( array $array, string $rootDir ) : array Recurses though resources and replaces schema strings
replaceSchemas ( array $array, array $schemas ) : array Replaces schema into the raml file
replaceTraits ( array $raml, array $traits, string $path, string $name ) : array Insert the traits into the RAML file
replaceTypes ( array $raml, array $types, string $path, string $name, string $parentKey = null ) : array Insert the types into the RAML file

Описание методов

__construct() публичный Метод

Create a new parser object - Optionally pass a list of parsers to use - If null is passed then the default schemaParsers are used
public __construct ( array $schemaParsers = null, array $securitySettingsParsers = null, array $fileLoaders = null, raml\ParseConfiguration $config = null )
$schemaParsers array
$securitySettingsParsers array
$fileLoaders array
$config raml\ParseConfiguration

addFileLoader() публичный Метод

Add a file loader
public addFileLoader ( Raml\FileLoader\FileLoaderInterface $fileLoader )
$fileLoader Raml\FileLoader\FileLoaderInterface

addSchemaParser() публичный Метод

Add a new schema parser
public addSchemaParser ( Raml\Schema\SchemaParserInterface $schemaParser )
$schemaParser Raml\Schema\SchemaParserInterface

addSecuritySettingParser() публичный Метод

Add a new security scheme
public addSecuritySettingParser ( Raml\SecurityScheme\SecuritySettingsParserInterface $securitySettingsParser )
$securitySettingsParser Raml\SecurityScheme\SecuritySettingsParserInterface

parse() публичный Метод

Parse a RAML spec from a file
public parse ( string $rawFileName ) : ApiDefinition
$rawFileName string
Результат ApiDefinition

parseFromString() публичный Метод

Parse a RAML spec from a string
public parseFromString ( string $ramlString, string $rootDir ) : ApiDefinition
$ramlString string
$rootDir string
Результат ApiDefinition

setConfiguration() публичный Метод

Set the parse configuration
public setConfiguration ( raml\ParseConfiguration $config )
$config raml\ParseConfiguration