Properties

$originalData

$originalData

$name

$name : string

Type

string

$description

$description : string

Type

string

$required

$required : bool

Type

bool

$pattern

$pattern : string

Type

string

$minimum

$minimum : int

Type

int

$maximum

$maximum : int

Type

int

$minLength

$minLength : int

Type

int

$maxLength

$maxLength : int

Type

int

$minItems

$minItems : int

Type

int

$maxItems

$maxItems : int

Type

int

$default

$default : mixed

Type

mixed

$static

$static : bool

Type

bool

$filters

$filters : array

Type

array

$location

$location : string

Type

string

$sentAs

$sentAs : string

Type

string

$data

$data : array

Type

array

$properties

$properties : array

Type

array

$additionalProperties

$additionalProperties : array|bool|\GuzzleHttp\Command\Guzzle\Parameter

Type

Parameter

$items

$items : array|\GuzzleHttp\Command\Guzzle\Parameter

Type

Parameter

$format

$format : string

Type

string

$propertiesCache

$propertiesCache

$serviceDescription

$serviceDescription : \GuzzleHttp\Command\Guzzle\Description

Type

Description

Methods

__construct()

__construct(array  $data = [], array  $options = []) : mixed

Create a new Parameter using an associative array of data.

The array can contain the following information:

  • name: (string) Unique name of the parameter

  • type: (string|array) Type of variable (string, number, integer, boolean, object, array, numeric, null, any). Types are used for validation and determining the structure of a parameter. You can use a union type by providing an array of simple types. If one of the union types matches the provided value, then the value is valid.

  • required: (bool) Whether or not the parameter is required

  • default: (mixed) Default value to use if no value is supplied

  • static: (bool) Set to true to specify that the parameter value cannot be changed from the default.

  • description: (string) Documentation of the parameter

  • location: (string) The location of a request used to apply a parameter. Custom locations can be registered with a command, but the defaults are uri, query, header, body, json, xml, formParam, multipart.

  • sentAs: (string) Specifies how the data being modeled is sent over the wire. For example, you may wish to include certain headers in a response model that have a normalized casing of FooBar, but the actual header is x-foo-bar. In this case, sentAs would be set to x-foo-bar.

  • filters: (array) Array of static method names to run a parameter value through. Each value in the array must be a string containing the full class path to a static method or an array of complex filter information. You can specify static methods of classes using the full namespace class name followed by '::' (e.g. Foo\Bar::baz). Some filters require arguments in order to properly filter a value. For complex filters, use a hash containing a 'method' key pointing to a static method, and an 'args' key containing an array of positional arguments to pass to the method. Arguments can contain keywords that are replaced when filtering a value: '@value' is replaced with the value being validated, '@api' is replaced with the Parameter object.

  • properties: When the type is an object, you can specify nested parameters

  • additionalProperties: (array) This attribute defines a schema for all properties that are not explicitly defined in an object type definition. If specified, the value MUST be a schema or a boolean. If false is provided, no additional properties are allowed beyond the properties defined in the schema. The default value is an empty schema which allows any value for additional properties.

  • items: This attribute defines the allowed items in an instance array, and MUST be a schema or an array of schemas. The default value is an empty schema which allows any value for items in the instance array. When this attribute value is a schema and the instance value is an array, then all the items in the array MUST be valid according to the schema.

  • pattern: When the type is a string, you can specify the regex pattern that a value must match

  • enum: When the type is a string, you can specify a list of acceptable values.

  • minItems: (int) Minimum number of items allowed in an array

  • maxItems: (int) Maximum number of items allowed in an array

  • minLength: (int) Minimum length of a string

  • maxLength: (int) Maximum length of a string

  • minimum: (int) Minimum value of an integer

  • maximum: (int) Maximum value of an integer

  • data: (array) Any additional custom data to use when serializing, validating, etc

  • format: (string) Format used to coax a value into the correct format when serializing or unserializing. You may specify either an array of filters OR a format, but not both. Supported values: date-time, date, time, timestamp, date-time-http, and boolean-string.

  • $ref: (string) String referencing a service description model. The parameter is replaced by the schema contained in the model.

Parameters

array $data

Array of data as seen in service descriptions

array $options

Options used when creating the parameter. You can specify a Guzzle service description in the 'description' key.

Throws

\InvalidArgumentException

Returns

mixed —

toArray()

toArray() : array

Convert the object to an array

Returns

array —

getValue()

getValue(string  $value) : mixed

Get the default or static value of the command based on a value

Parameters

string $value

Value that is currently set

Returns

mixed —

Returns the value, a static value if one is present, or a default value

filter()

filter(mixed  $value) : mixed

Run a value through the filters OR format attribute associated with the parameter.

Parameters

mixed $value

Value to filter

Throws

\RuntimeException

when trying to format when no service description is available.

Returns

mixed —

Returns the filtered value

getName()

getName() : string

Get the name of the parameter

Returns

string —

setName()

setName(string  $name) : mixed

Set the name of the parameter

Parameters

string $name

Name to set

Returns

mixed —

getWireName()

getWireName() : string

Get the key of the parameter, where sentAs will supersede name if it is set.

Returns

string —

getType()

getType() : string|array

Get the type(s) of the parameter

Returns

string|array —

isRequired()

isRequired() : bool

Get if the parameter is required

Returns

bool —

getDefault()

getDefault() : string|null

Get the default value of the parameter

Returns

string|null —

getDescription()

getDescription() : string|null

Get the description of the parameter

Returns

string|null —

getMinimum()

getMinimum() : int|null

Get the minimum acceptable value for an integer

Returns

int|null —

getMaximum()

getMaximum() : int|null

Get the maximum acceptable value for an integer

Returns

int|null —

getMinLength()

getMinLength() : int

Get the minimum allowed length of a string value

Returns

int —

getMaxLength()

getMaxLength() : int|null

Get the maximum allowed length of a string value

Returns

int|null —

getMaxItems()

getMaxItems() : int|null

Get the maximum allowed number of items in an array value

Returns

int|null —

getMinItems()

getMinItems() : int

Get the minimum allowed number of items in an array value

Returns

int —

getLocation()

getLocation() : string|null

Get the location of the parameter

Returns

string|null —

getSentAs()

getSentAs() : string|null

Get the sentAs attribute of the parameter that used with locations to sentAs an attribute when it is being applied to a location.

Returns

string|null —

getData()

getData(string|null  $name = null) : array|mixed|null

Retrieve a known property from the parameter by name or a data property by name. When no specific name value is passed, all data properties will be returned.

Parameters

string|null $name

Specify a particular property name to retrieve

Returns

array|mixed|null —

isStatic()

isStatic() : bool

Get whether or not the default value can be changed

Returns

bool —

getFilters()

getFilters() : array

Get an array of filters used by the parameter

Returns

array —

getProperties()

getProperties() : \GuzzleHttp\Command\Guzzle\Parameter[]

Get the properties of the parameter

Returns

\GuzzleHttp\Command\Guzzle\Parameter[] —

getProperty()

getProperty(string  $name) : null|\GuzzleHttp\Command\Guzzle\Parameter

Get a specific property from the parameter

Parameters

string $name

Name of the property to retrieve

Returns

null|\GuzzleHttp\Command\Guzzle\Parameter —

getAdditionalProperties()

getAdditionalProperties() : bool|\GuzzleHttp\Command\Guzzle\Parameter|null

Get the additionalProperties value of the parameter

Returns

bool|\GuzzleHttp\Command\Guzzle\Parameter|null —

getItems()

getItems() : \GuzzleHttp\Command\Guzzle\Parameter

Get the item data of the parameter

Returns

\GuzzleHttp\Command\Guzzle\Parameter —

getEnum()

getEnum() : array|null

Get the enum of strings that are valid for the parameter

Returns

array|null —

getPattern()

getPattern() : string

Get the regex pattern that must match a value when the value is a string

Returns

string —

getFormat()

getFormat() : string

Get the format attribute of the schema

Returns

string —

has()

has(string  $var) : bool

Check if a parameter has a specific variable and if it set.

Parameters

string $var

Returns

bool —

setFilters()

setFilters(array  $filters) : self

Set the array of filters used by the parameter

Parameters

array $filters

Array of functions to use as filters

Returns

self —

addFilter()

addFilter(string|array  $filter) : self

Add a filter to the parameter

Parameters

string|array $filter

Method to filter the value through

Throws

\InvalidArgumentException

Returns

self —