Get all form element errors

@return array
557402
public function getAllErrors()
    {
        $errors = [];
        $fields = $this->getFields();
        foreach ($fields as $name => $field) {
            if ($field->hasErrors()) {
                $errors[str_replace('[]', '', $field->getName())] = $field->getErrors();
            }
        }
        return $errors;
    }
16201
public static function get() : array
  {
    return [
      'csrf_token' => CSRF::generate(),
      'errors' => Variable::has('validation.errors') ? Variable::get('validation.errors') : (new ValidatorFactory())->make([], [])->errors(),
      'old' => Variable::has('form.old') ? Variable::get('form.old') : [],
    ];
  }
982433
public function getFormErrors(FormInterface $form, $transDomain = 'System'): array
    {
        if (!$form->isSubmitted() || false) return [];

        $messages = $this->getMessageManager();

        $errorList = $this->getParser()->parseErrors($form);
        $errorList = is_array($errorList) ? $errorList: [];

        foreach($errorList as $q=>$w) {
            $errorList[$q]['messages'] = [];
            foreach($w['errors'] as $error) {
                $errorList[$q]['messages'][] = $error->getMessage();
                $messages->addMessage('danger', $error->getMessage(), [], false);
            }
        }
        if (empty($errorList))
            $messages->addMessage('success', 'All details were saved successfully.', [], 'System');

        return $messages->serialiseTranslatedMessages($this->getTranslator());
    }
581005
public function allErrorArray() {
        $r=array();
        foreach($this->items as $v) {
            $r=array_merge($r,$v->allError());
        }
        return $r;
    }
990140
protected function getRawErrors() {
        foreach ($this->errors as $field => $errors) {
            foreach ($errors as $error) {
                yield $field => $error;
            }
        }
    }
1205618
public function getValidationErrors($value)
	{
		$errors = array();
		if($this->required===true and !$value)
		{
			$errors['required'] = 'this element is required';
		}
		if(isset($this->defaultValue) and !empty($this->readonly) and $value!=$this->defaultValue)
		{
			$errors['readonly'] = 'this element is readonly';
		}
		return $errors;
	}
524935
public static function getUploadErrorMessages()
    {
        return [
            UPLOAD_ERR_OK => Module::t('upload_err_message_0'),
            UPLOAD_ERR_INI_SIZE => Module::t('upload_err_message_1'),
            UPLOAD_ERR_FORM_SIZE =>  Module::t('upload_err_message_2'),
            UPLOAD_ERR_PARTIAL =>  Module::t('upload_err_message_3'),
            UPLOAD_ERR_NO_FILE =>  Module::t('upload_err_message_4'),
            UPLOAD_ERR_NO_TMP_DIR =>  Module::t('upload_err_message_6'),
            UPLOAD_ERR_CANT_WRITE =>  Module::t('upload_err_message_7'),
            UPLOAD_ERR_EXTENSION =>  Module::t('upload_err_message_8'),
        ];
    }
817711
protected function getAttributes()
    {
        libxml_use_internal_errors(true);
        $dom = new DOMDocument('1.0', 'UTF-8');
        $dom->resolveExternals = false;
        $dom->validateOnParse = true;
        $dom->preserveWhiteSpace = false;
        $dom->strictErrorChecking = true;
        $dom->recover = true;

        @$dom->loadHTML($this->normalize($this->html));

        $errors = array_filter(libxml_get_errors(), function (LibXMLError $error) {
            return in_array((int) $error->code, static::$ignoreErrors, true) === false;
        });

        libxml_clear_errors();

        return [
            'severenity' => static::$severenity,
            'counter' => count($errors),
            'errors' => $errors,
            'html' => $this->html,
        ];
    }
695510
public function getAllErrors()
    {
        $errors = $this->getErrors();

        $types = $this->getClasses()->merge($this->getInterfaces())->merge($this->getTraits());

        $elements = $this->getFunctions()->merge($this->getConstants())->merge($types);

        foreach ($elements as $element) {
            if (!$element) {
                continue;
            }

            $errors = $errors->merge($element->getErrors());
        }

        foreach ($types as $element) {
            if (!$element) {
                continue;
            }

            foreach ($element->getMethods() as $item) {
                if (!$item) {
                    continue;
                }

                $errors = $errors->merge($item->getErrors());
            }

            if (method_exists($element, 'getConstants')) {
                foreach ($element->getConstants() as $item) {
                    if (!$item) {
                        continue;
                    }

                    $errors = $errors->merge($item->getErrors());
                }
            }

            if (method_exists($element, 'getProperties')) {
                foreach ($element->getProperties() as $item) {
                    if (!$item) {
                        continue;
                    }

                    $errors = $errors->merge($item->getErrors());
                }
            }
        }

        return $errors;
    }
517534
def errors(self):
        
        if not hasattr(self, '_errors_cache'):
            self._errors_cache = self.form.get_field_errors(self)
        return self._errors_cache
1175166
public function getErrorMessages(Form $form)
    {
        $errors = '';

        foreach ($form->getErrors() as $key => $error) {
            $errors .= $error->getMessage().', ';
        }

        /** @var Form $child */
        foreach ($form->all() as $child) {
            if (!$child->isValid()) {
                $fieldName = $child->getConfig()->getOption('label', null);

                if (empty($fieldName)) {
                    $fieldName = $child->getName();
                }

                $errors .= sprintf("[%s] %s, ", $fieldName, $this->getErrorMessages($child));
            }
        }

        return rtrim($errors, ', ');
    }
1243398
public function getFirstErrors(): array
    {
        $errors = $this->getErrors();
        if (empty($errors)) {
            return [];
        } else {
            $errors = [];
            foreach ($errors as $name => $es) {
                if (!empty($es)) {
                    $errors[$name] = reset($es);
                }
            }

            return $errors;
        }
    }
176466
public function getErrors()
    {
        $errors = array();
        /** @var \tao_helpers_form_Validator $validator */
        foreach ($this->validators as $validator) {
            $errors[] = $validator->getMessage();
        }

        return $errors;
    }
177236
protected function getFormErrors(FormInterface $form)
    {
        $errors = [];
        foreach ($form->getErrors() as $error) {
            $errors[] = $error->getMessage();
        }
        foreach ($form->all() as $child) {
            if (!$child->isValid()) {
                $errors[$child->getName()] = $this->getFormErrors($child);
            }
        }

        return $errors;
    }
229439
public function getElements() {

        $elements = array();
        foreach ($this->modules as $module) {
            if (!$this->trusted && !$module->safe) continue;
            foreach ($module->info as $name => $v) {
                if (isset($elements[$name])) continue;
                $elements[$name] = $this->getElement($name);
            }
        }

        // remove dud elements, this happens when an element that
        // appeared to be safe actually wasn't
        foreach ($elements as $n => $v) {
            if ($v === false) unset($elements[$n]);
        }

        return $elements;

    }
930978
public function getValidationErrors()
    {
        return [
            /** Bundle option related errors */
            __('The options you selected are not available.')->render(),
            __('The required options you selected are not available.')->render(),
            __('Please specify product option(s).')->render(),
            __('Please select all required options.')->render(),
            __('You need to choose options for your item.')->render(),

            /** Input field related errors */
            __('The text is too long.')->render(),
            __('Please specify product\'s required option(s).')
        ];
    }
765528
protected function getElementErrorsHelper()
    {
        if ($this->elementErrorsHelper) {
            return $this->elementErrorsHelper;
        }

        if (method_exists($this->view, 'plugin')) {
            $this->elementErrorsHelper = $this->view->plugin('bootstrap_form_element_errors');
        }

        if (!$this->elementErrorsHelper instanceof FormElementErrors) {
            $this->elementErrorsHelper = new FormElementErrors();
        }

        return $this->elementErrorsHelper;
    }