public function getErrors($type = self::ERROR_ALL) {
        if ($type === self::ERROR_ALL) {
            return $this->_errors;
        }

        $clean = array();

        if ($this->_errors) {
            foreach ($this->_errors as $error) {
                if ($error['type'] === self::ERROR_NESTING) {
                    $clean[] = $error;

                } else if ($error['type'] === self::ERROR_CLOSING) {
                    $clean[] = $error;

                } else if ($error['type'] === self::ERROR_SCOPE) {
                    $clean[] = $error;
                }
            }
        }

        return $clean;
    }