public function clearErrors($attribute = null)
    {
        if ($attribute === null) {
            $this->_errors = [];
        } else {
            unset($this->_errors[$attribute]);
        }
    }
public function clearErrors($attribute = null)
    {
        if ($attribute === null) {
            $this->_errors = [];
        } else {
            unset($this->_errors[$attribute]);
        }
    }
public function clearErrors ( $ attribute = null ) { if ( $ attribute === null ) { $ this -> _errors = [ ] ; } else { unset ( $ this -> _errors [ $ attribute ] ) ; } }
Removes errors for all attributes or a single attribute.
@param string $attribute attribute name. Use null to remove errors for all attributes.
Removes errors for all attributes or a single attribute .