Open Journal Systems  3.3.0
Guzzle\Service\Description\SchemaValidator Class Reference
Inheritance diagram for Guzzle\Service\Description\SchemaValidator:
Guzzle\Service\Description\ValidatorInterface

Public Member Functions

 __construct ($castIntegerToStringType=true)
 
 getErrors ()
 
 validate (Parameter $param, &$value)
 

Static Public Member Functions

static getInstance ()
 

Protected Member Functions

 determineType ($type, $value)
 
 recursiveProcess (Parameter $param, &$value, $path='', $depth=0)
 

Protected Attributes

 $castIntegerToStringType
 
 $errors
 

Static Protected Attributes

static $instance
 

Detailed Description

Default parameter validator

Definition at line 10 of file SchemaValidator.php.

Constructor & Destructor Documentation

◆ __construct()

Guzzle\Service\Description\SchemaValidator::__construct (   $castIntegerToStringType = true)
Parameters
bool$castIntegerToStringTypeSet to true to convert integers into strings when a required type is a string and the input value is an integer. Defaults to true.

Definition at line 44 of file SchemaValidator.php.

References Guzzle\Service\Description\SchemaValidator\$castIntegerToStringType.

Member Function Documentation

◆ determineType()

Guzzle\Service\Description\SchemaValidator::determineType (   $type,
  $value 
)
protected

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

Parameters
string$typeParameter type
mixed$valueValue to determine the type
Returns
string|bool Returns the matching type on

Definition at line 271 of file SchemaValidator.php.

Referenced by Guzzle\Service\Description\SchemaValidator\recursiveProcess().

◆ getErrors()

Guzzle\Service\Description\SchemaValidator::getErrors ( )

Get the errors encountered while validating

Returns
array

Implements Guzzle\Service\Description\ValidatorInterface.

Definition at line 67 of file SchemaValidator.php.

◆ getInstance()

static Guzzle\Service\Description\SchemaValidator::getInstance ( )
static
Returns
self @codeCoverageIgnore

Definition at line 31 of file SchemaValidator.php.

References Guzzle\Service\Description\SchemaValidator\$instance.

Referenced by Guzzle\Service\Command\AbstractCommand\getValidator().

◆ recursiveProcess()

Guzzle\Service\Description\SchemaValidator::recursiveProcess ( Parameter  $param,
$value,
  $path = '',
  $depth = 0 
)
protected

Recursively validate a parameter

Parameters
Parameter$paramAPI parameter being validated
mixed$valueValue to validate and validate. The value may change during this validate.
string$pathCurrent validation path (used for error reporting)
int$depthCurrent depth in the validation validate
Returns
bool Returns true if valid, or false if invalid

Definition at line 82 of file SchemaValidator.php.

References Guzzle\Service\Description\SchemaValidator\$instance, Guzzle\Service\Description\SchemaValidator\determineType(), Guzzle\Service\Description\Parameter\getAdditionalProperties(), Guzzle\Service\Description\Parameter\getDescription(), Guzzle\Service\Description\Parameter\getEnum(), Guzzle\Service\Description\Parameter\getInstanceOf(), Guzzle\Service\Description\Parameter\getItems(), Guzzle\Service\Description\Parameter\getMaximum(), Guzzle\Service\Description\Parameter\getMaxItems(), Guzzle\Service\Description\Parameter\getMaxLength(), Guzzle\Service\Description\Parameter\getMinimum(), Guzzle\Service\Description\Parameter\getMinItems(), Guzzle\Service\Description\Parameter\getMinLength(), Guzzle\Service\Description\Parameter\getName(), Guzzle\Service\Description\Parameter\getPattern(), Guzzle\Service\Description\Parameter\getProperties(), Guzzle\Service\Description\Parameter\getRequired(), Guzzle\Service\Description\Parameter\getStatic(), Guzzle\Service\Description\Parameter\getType(), and Guzzle\Service\Description\Parameter\getValue().

Referenced by Guzzle\Service\Description\SchemaValidator\validate().

◆ validate()

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

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
Parameter$paramSchema that is being validated against the value
mixed$valueValue to validate and process. The value may change during this process.
Returns
bool Returns true if the input data is valid for the schema

Implements Guzzle\Service\Description\ValidatorInterface.

Definition at line 49 of file SchemaValidator.php.

References Guzzle\Service\Description\SchemaValidator\recursiveProcess().

Field Documentation

◆ $castIntegerToStringType

self Guzzle\Service\Description\SchemaValidator::$castIntegerToStringType
protected

◆ $errors

array Guzzle\Service\Description\SchemaValidator::$errors
protected

Errors encountered while validating

Definition at line 25 of file SchemaValidator.php.

◆ $instance

Guzzle\Service\Description\SchemaValidator::$instance
staticprotected

The documentation for this class was generated from the following file: