\Guzzle\Service\DescriptionServiceDescriptionLoader

Loader for service descriptions

Summary

Methods
Properties
Constants
load()
addAlias()
removeAlias()
No public properties found
No constants found
build()
loadFile()
mergeIncludes()
mergeData()
resolveExtension()
$aliases
$loadedFiles
$jsonErrors
N/A
No private methods found
No private properties found
N/A

Properties

$aliases

$aliases : array

Type

array — Array of aliases for actual filenames

$loadedFiles

$loadedFiles : array

Type

array — Hash of previously loaded filenames

$jsonErrors

$jsonErrors : array

Type

array — JSON error code mappings

Methods

load()

load(mixed  $config, array  $options = array()) : mixed

Loads configuration data and returns an array of the loaded result

Parameters

mixed $config

Data to load (filename or array of data)

array $options

Array of options to use when loading

Returns

mixed

addAlias()

addAlias(string  $filename, string  $alias) : self

Add an include alias to the loader

Parameters

string $filename

Filename to alias (e.g. _foo)

string $alias

Actual file to use (e.g. /path/to/foo.json)

Returns

self

removeAlias()

removeAlias(string  $alias) : self

Remove an alias from the loader

Parameters

string $alias

Alias to remove

Returns

self

build()

build(array  $config, array  $options) : mixed

Perform the parsing of a config file and create the end result

Parameters

array $config

Configuration data

array $options

Options to use when building

Returns

mixed

loadFile()

loadFile(string  $filename) : array

Load a configuration file (can load JSON or PHP files that return an array when included)

Parameters

string $filename

File to load

Throws

\Guzzle\Common\Exception\InvalidArgumentException
\Guzzle\Common\Exception\RuntimeException

when the JSON cannot be parsed

Returns

array

mergeIncludes()

mergeIncludes(array  $config, string  $basePath = null) : array

Merges in all include files

Parameters

array $config

Config data that contains includes

string $basePath

Base path to use when a relative path is encountered

Returns

array —

Returns the merged and included data

mergeData()

mergeData(array  $a, array  $b) : array

Default implementation for merging two arrays of data (uses array_merge_recursive)

Parameters

array $a

Original data

array $b

Data to merge into the original and overwrite existing values

Returns

array

resolveExtension()

resolveExtension(string  $name, array  $op, array  $operations) 

Parameters

string $name

Name of the operation

array $op

Operation value array

array $operations

Currently loaded operations

Throws

\Guzzle\Service\Exception\DescriptionBuilderException

when extending a non-existent operation