\Guzzle\Service\DescriptionSchemaValidator

Default parameter validator

Summary

Methods
Properties
Constants
getInstance()
__construct()
validate()
getErrors()
No public properties found
No constants found
recursiveProcess()
determineType()
$instance
$castIntegerToStringType
$errors
N/A
No private methods found
No private properties found
N/A

Properties

$instance

$instance : self

Type

self — Cache instance of the object

$castIntegerToStringType

$castIntegerToStringType : boolean

Type

boolean — Whether or not integers are converted to strings when an integer is received for a string input

$errors

$errors : array

Type

array — Errors encountered while validating

Methods

getInstance()

getInstance() : self

Returns

self

__construct()

__construct(boolean  $castIntegerToStringType = true) 

Parameters

boolean $castIntegerToStringType

Set to true to convert integers into strings when a required type is a string and the input value is an integer. Defaults to true.

validate()

validate(\Guzzle\Service\Description\Parameter  $param, mixed  $value) : boolean

Validate a value against the acceptable types, regular expressions, minimum, maximums, instanceOf, enums, etc Add default and static values to the passed in variable. If the validation completes successfully, the input must be run correctly through the matching schema's filters attribute.

Parameters

\Guzzle\Service\Description\Parameter $param

Schema that is being validated against the value

mixed $value

Value to validate and process. The value may change during this process.

Returns

boolean —

Returns true if the input data is valid for the schema

getErrors()

getErrors() : array

Get the errors encountered while validating

Returns

array

recursiveProcess()

recursiveProcess(\Guzzle\Service\Description\Parameter  $param, mixed  $value, string  $path = '', integer  $depth) : boolean

Recursively validate a parameter

Parameters

\Guzzle\Service\Description\Parameter $param

API parameter being validated

mixed $value

Value to validate and validate. The value may change during this validate.

string $path

Current validation path (used for error reporting)

integer $depth

Current depth in the validation validate

Returns

boolean —

Returns true if valid, or false if invalid

determineType()

determineType(string  $type, mixed  $value) : string|boolean

From the allowable types, determine the type that the variable matches

Parameters

string $type

Parameter type

mixed $value

Value to determine the type

Returns

string|boolean —

Returns the matching type on