Get a short list of errors with options

@return string
777012
public function getErrorReport()
    {
        if (empty($this->errors)) {
            return '';
        }
        $r = "Some arguments did not pass validation:\n";
        foreach ($this->errors as $letter => $arr) {
            $r .= "  $letter : " . implode(', ', $arr) . "\n";
        }
        $r .= "\n";

        return $r;
    }
7853
public function getFlatErrors(): array
    {
        /**
         * Reducer that flat the errors.
         *
         * @param array   $carry previous error list
         * @param Invalid $item  to append to $carry
         *
         * @return array<Invalid>
         */
        $reduce = function(array $carry, Invalid $item) use(&$reduce) {
            if ($item instanceof self) {
                $carry = array_merge($carry, $item->getFlatErrors());
            } else {
                $carry[] = $item;
            }
            if ($item->getPrevious()) {
                $carry = $reduce($carry, $item->getPrevious());
            }

            return $carry;
        };

        return array_reduce($this->errors, $reduce, []);
    }
384320
public function getAllErrors() {

        $errors = array();
        // First the table itself
        if ($this->getError()) {
            $errors[] = $this->getError();
        }
        // Delegate to fields
        if ($fields = $this->getFields()) {
            foreach ($fields as $field) {
                if ($field->getError()) {
                    $errors[] = $field->getError();
                }
            }
        }
        // Delegate to keys
        if ($keys = $this->getKeys()) {
            foreach ($keys as $key) {
                if ($key->getError()) {
                    $errors[] = $key->getError();
                }
            }
        }
        // Delegate to indexes
        if ($indexes = $this->getIndexes()) {
            foreach ($indexes as $index) {
                if ($index->getError()) {
                    $errors[] = $index->getError();
                }
            }
        }
        // Return decision
        if (count($errors)) {
            return $errors;
        } else {
            return false;
        }
    }
150822
public function getAllErrors() : array
    {
        $errors = $this->getErrors();

        foreach ($this->components as $component) {
            $errors = array_merge($errors, $component->getErrors());
        }

        return $errors;
    }
990140
protected function getRawErrors() {
        foreach ($this->errors as $field => $errors) {
            foreach ($errors as $error) {
                yield $field => $error;
            }
        }
    }
845778
public function getProcessedErrors()
    {
        $errors = [];

        foreach ($this->errors as $error) {
            // Process replacements
            $message = ArrDots::get($this->messages['custom'], $error['attribute'])
                       ?? ArrDots::get($this->messages['rules'], $error['rule']);
            foreach ($error['replacements'] as $search => $replace) {
                switch ($search[0]) {
                    case ':':
                        $message = str_replace($search, Str::prettyAttribute($replace), $message);
                        break;
                    case '!':
                        if (!$replace) {
                            break;
                        }
                        // Check if the attribute is singular (use group 1) or plural (use group 2)
                        // Group 2 if plural, group 1 if singular
                        $replace = substr($error['replacements'][':attribute'] ?? '', -1, 1) !== static::WILD
                            ? '$1' : '$2';
                        $message = preg_replace("/$search/", $replace, $message);
                        break;

                    case '%':
                    default:
                        $message = str_replace($search, $replace, $message);
                        break;
                }
            }
            $errors[$error['attribute']][$error['rule']] = $message;
        }

        return ['errors' => $errors];
    }
642919
function getErrors()
    {
        if (!$this->errors){
            $this->errors = new Error('Ошибки', 'errors', null, true);
        }
        return $this->errors;
    }
886309
public function getErrorsAsText(): string
    {
        $result = '';
        $fieldCounter = 0;
        $fields = $this->getErrors();

        foreach ($fields as $fieldName => $fieldErrors) {
            $fieldCounter++;
            $result .= "$fieldCounter) $fieldName\n";

            foreach ($fieldErrors as $error) {
                $result .= "   - $error\n";
            }
        }

        return $result;
    }
399953
public function getValidationErrors()
    {
        $errors = [];
        if (isset($this->response->errors)) {
            foreach ($this->response->errors as $error => $reasons) {
                $errors[] = [
                    'attribute' => $error,
                    'reason'    => $this->getValidationReasonsAsString($reasons),
                ];
            }
        }

        return $errors;
    }
549222
public function errorInfo()
	{
		return array
		(
			0 => $this->driver->getSQLState(),
			1 => $this->driver->getErrorCode(),
			2 => $this->driver->getLastMessage()
		);
	}
728705
public function outputGroupedErrors()
    {
        if (empty($this->errors)) {
            return '';
        }
        if (!empty($this->options['errors_prefix'])) {
            $errorHtml = str_replace(array('<qf:message>', '</qf:message>', '{message}'),
                                     array('', '', $this->options['errors_prefix']),
                                     $this->templatesForClass['special:error']['prefix']);
        } else {
            $errorHtml = preg_replace('!<qf:message>.*</qf:message>!isU', '',
                                      $this->templatesForClass['special:error']['prefix']);
        }
        $errorHtml .= implode($this->templatesForClass['special:error']['separator'], $this->errors);
        if (!empty($this->options['errors_suffix'])) {
            $errorHtml .= str_replace(array('<qf:message>', '</qf:message>', '{message}'),
                                      array('', '', $this->options['errors_suffix']),
                                      $this->templatesForClass['special:error']['suffix']);
        } else {
            $errorHtml .= preg_replace('!<qf:message>.*</qf:message>!isU', '',
                                      $this->templatesForClass['special:error']['suffix']);
        }
        return $errorHtml;
    }
913526
public function getErrors()
    {
        $arr_errors = [];

        if (! extension_loaded('gd') && ! extension_loaded('imagick')) {
            array_push($arr_errors, trans('laravel-filemanager::lfm.message-extension_not_found'));
        }

        if (! extension_loaded('exif')) {
            array_push($arr_errors, 'EXIF extension not found.');
        }

        if (! extension_loaded('fileinfo')) {
            array_push($arr_errors, 'Fileinfo extension not found.');
        }

        $mine_config_key = 'lfm.folder_categories.'
            . $this->helper->currentLfmType()
            . '.valid_mime';

        if (! is_array(config($mine_config_key))) {
            array_push($arr_errors, 'Config : ' . $mine_config_key . ' is not a valid array.');
        }

        return $arr_errors;
    }
151390
public function any_error_messages() {
        $errors = array();
        foreach ($this->get_all_slots() as $slot) {
            foreach ($this->for_slot($slot)->get_sub_question_ids() as $subqid) {
                if ($this->for_subq($subqid)->differentweights) {
                    $name = $this->for_subq($subqid)->question->name;
                    $errors[] = get_string('erroritemappearsmorethanoncewithdifferentweight', 'question', $name);
                }
            }
        }
        return $errors;
    }
1374721
public function getErrors() {
        $result = array();

        if (count($this->errors) > 0) {
            if (isset($this->errors['common'])) {
                $result['common'] = $this->errors['common'];
            }
            if (isset($this->errors['fields'])) {
                foreach ($this->errors['fields'] as $key => $value) {
                    $result[$key] = $value;
                }
            }
        }
        
        return $result;
    }
1051531
public function getErrors(): array
    {
        $errors = $this->validate()->getErrors();
        foreach ($errors as &$error) {
            if (is_string($error) && Translator::isMessage($error)) {
                // translate error message
                $error = $this->say($error);
            }

            unset($error);
        }

        return $errors;
    }
586750
public function get_error(){
    if ( $this->error ){
      return [
        'code' => $this->error,
        'text' => $this->class_cfg['errors'][$this->error]
      ];
    }
    return false;
  }
398295
public function getShortError()
	{
		$error	= array_shift( explode( "\n", trim( $this->error ) ) );
		$error	= preg_replace( "@^Parse error: (.*) in (.*) on (.*)$@i", "\\1 on \\3", $error );
		return $error;
	}