src/Validation.php
public function merge(Validation $validation, $name = '') {
        $paths = $validation->errors;

        foreach ($paths as $path => $errors) {
            foreach ($errors as $error) {
                if (strlen($name) > 0) {
                    // We are merging a sub-schema error that did not occur on a particular property of the sub-schema.
                    if ($path === '') {
                        $fullPath = $name;
                    } else {
                        $fullPath = "{$name}/{$path}";
                    }
                    $this->addError($fullPath, $error['error'], $error);
                }
            }
        }
        return $this;
    }
public function merge(Validation $validation, $name = '') {
        $paths = $validation->errors;

        foreach ($paths as $path => $errors) {
            foreach ($errors as $error) {
                if (strlen($name) > 0) {
                    // We are merging a sub-schema error that did not occur on a particular property of the sub-schema.
                    if ($path === '') {
                        $fullPath = $name;
                    } else {
                        $fullPath = "{$name}/{$path}";
                    }
                    $this->addError($fullPath, $error['error'], $error);
                }
            }
        }
        return $this;
    }
public function merge ( Validation $ validation , $ name = '' ) { $ paths = $ validation -> errors ; foreach ( $ paths as $ path => $ errors ) { foreach ( $ errors as $ error ) { if ( strlen ( $ name ) > 0 ) { // We are merging a sub-schema error that did not occur on a particular property of the sub-schema. if ( $ path === '' ) { $ fullPath = $ name ; } else { $ fullPath = "{$name}/{$path}" ; } $ this -> addError ( $ fullPath , $ error [ 'error' ] , $ error ) ; } } } return $ this ; }
Merge another validation object with this one.

@param Validation $validation The validation object to merge.
@param string $name The path to merge to. Use this parameter when the validation object is meant to be a subset of this one.
@return $this
Merge another validation object with this one .