public function addError($error)
    {
        if ($error instanceof self) {
            $this->errors = array_merge($this->errors, $error->errors);
        } else {
            $this->errors[] = $error;
        }

        return $this;
    }
public function addError($error)
    {
        if ($error instanceof self) {
            $this->errors = array_merge($this->errors, $error->errors);
        } else {
            $this->errors[] = $error;
        }

        return $this;
    }
public function addError ( $ error ) { if ( $ error instanceof self ) { $ this -> errors = array_merge ( $ this -> errors , $ error -> errors ) ; } else { $ this -> errors [ ] = $ error ; } return $ this ; }
Add an error that occurred when building this Definition.

@param string|\Closure|self $error

@return $this
Add an error that occurred when building this Definition .