Gets all of the errors as a flat array.

The errors are internally stored indexed by field. This method flattens them for final error returns.

@return array Returns all of the errors.
14687
public function getErrors(): array {
        $result = [];
        foreach ($this->getRawErrors() as $field => $error) {
            $result[] = $this->pluckError(['field' => $field] + $error);
        }
        return $result;
    }
1168716
public static function errors()
    {
        $result                    = array();
        $result['error_reporting'] = error_reporting();
        $errTypes                  = self::_getErrorTypes();

        foreach ($errTypes as $errTypeKey => $errTypeName) {
            if ($result['error_reporting'] & $errTypeKey) {
                $result['show_types'][] = $errTypeName . ' (' . $errTypeKey . ')';
            }
        }

        return self::i()->dump($result, '! errors info !');
    }
178191
public function getAllMessages()
    {
        $messages = [];
        foreach (array_keys($this->errors) as $key) {
            $messages = array_merge($messages, $this->getMessages($key));
        }
        return $messages;
    }
544993
public function getErrors()
    {
        if (false === $this->errors) {
            $this->errors = array();
        }

        if (!is_array($this->errors)) {
            $this->errors = array($this->errors);
        }

        return $this->errors;
    }
1038304
public function toArray()
    {
        $data = parent::toArray();

        $data = array_intersect_key($data, $this->_fields);

        return $data;
    }
1138428
private function all(): array
    {
        $fields = static::$_fields;

        $data = [];
        foreach ($fields as $f) {
            if (isset($this->$f) and !is_null($this->$f)) {
                $data[$f] = $this->$f;
            }
        }

        return $data;
    }
370386
protected function getNonBreakingErrors()
    {
        $errors = [];

        $unknownRelations = $this->unknownRelationsFromRequest();
        if (count($unknownRelations) > 0) {
            $errors[] = [
                'code' => static::ERROR_UNKNOWN_LINKED_RESOURCES,
                'title' => 'Unknown included resource requested',
                'description' => 'These included resources are not available: ' . implode(', ', $unknownRelations)
            ];
        }

        return $errors;
    }
425191
public function getErrors()
    {
        if (!empty($this->fixed_error))
            return count($this->errors) ? [$this->fixed_error] : [];

        return $this->errors;
    }
167516
public function getErrorMessages()
    {
        $errors = [];
        foreach ($this->fields as $field) {
            if ($field instanceof AbstractFormField && !$field->isValid()) {
                $fldErrors = $field->getErrorMessages();
                $errors = array_merge($errors, $fldErrors);
            }
        }

        return $errors;
    }
1193804
public function getMissingErrors()
    {
        return array_combine(
            array_keys($this->missingAttribs),
            array_map(function ($ref) {
                return $ref['error'];
            }, array_values($this->missingAttribs))
        );
    }
1141964
public function errors() : array
    {
        $errors = [];
        foreach ($this->tests as $error => $test) {
            if (!$test($this->getValue())) {
                $errors[] = $error;
            }
        }
        return $errors;
    }
523654
public function errors()
    {
        $errors = parent::errors();

        if ( ! empty($errors)) {
            $errors[ $this->generalErrorsKey() ] = $this->collectGeneralErrors($errors);
        }

        return $errors;
    }
761038
public function getError()
    {
        if ($this->errorCode !== null || $this->success === false) {
            return [
                'code'    => $this->errorCode === null ? self::UNKNOWN_ERROR_CODE : $this->errorCode,
                'message' => $this->errorMessage === null ? self::UNKNOWN_ERROR_MSG : $this->errorMessage
            ];
        } else {
            return null;
        }
    }
702736
public function exportErrors()
    {
        $ret = [];
        foreach ($this->errors as $error) {
            $ret[] = $error->export();
        }
        return $ret;
    }
19698
public function getErrors()
    {
        $errors = array();

        $entityContainers = $this->getEntityContainerMap()->getAll();

        /**
         * @var EntityContainerInterface $entityContainer
         */
        foreach ($entityContainers as $entityContainer) {
            if ($entityContainer->hasErrors()) {
                $errors[$entityContainer->getName()] = $entityContainer->getErrors();
            }
        }

        return $errors;
    }
293008
private function flattenErrors(array $errors): array
    {
        $flattenErrors = [];

        foreach ($errors as $error) {
            $rawException = $error->getPrevious();
            // multiple errors
            if ($rawException instanceof UserErrors) {
                $rawExceptions = $rawException;
                foreach ($rawExceptions->getErrors() as $rawException) {
                    $flattenErrors[] = GraphQLError::createLocatedError($rawException, $error->nodes, $error->path);
                }
            } else {
                $flattenErrors[] = $error;
            }
        }

        return $flattenErrors;
    }
1136891
public function __toArray()
    {
        $result = array();
        $idx = 0;
        foreach ($this->var as $idx => $line) {
            $result[] = $line->__toFields();
        }
        return $result;
    }