PHP 클래스 Raml\Parser

파일 보기 프로젝트 열기: alecsammon/php-raml-parser 1 사용 예제들

공개 메소드들

메소드 설명
__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