public function validate(array &$data, Validation &$validation = null) {
        if (!$this->isValidInternal($data, $this->schema, $validation, '')) {
            if ($validation === null) {
                // Although this should never be null, scrutinizer complains that it might be.
                $validation = new Validation();
            }

            throw new ValidationException($validation);
        }
        return $this;
    }
public function validate(array &$data, Validation &$validation = null) {
        if (!$this->isValidInternal($data, $this->schema, $validation, '')) {
            if ($validation === null) {
                // Although this should never be null, scrutinizer complains that it might be.
                $validation = new Validation();
            }

            throw new ValidationException($validation);
        }
        return $this;
    }
public function validate ( array & $ data , Validation & $ validation = null ) { if ( ! $ this -> isValidInternal ( $ data , $ this -> schema , $ validation , '' ) ) { if ( $ validation === null ) { // Although this should never be null, scrutinizer complains that it might be. $ validation = new Validation ( ) ; } throw new ValidationException ( $ validation ) ; } return $ this ; }
Validate data against the schema.

@param array &$data The data to validate.
@param Validation &$validation This argument will be filled with the validation result.
@return bool Returns true if the data is valid, false otherwise.
@throws ValidationException Throws an exception when the data does not validate against the schema.
Validate data against the schema .