Backend\Core\Engine\FormFile::getErrors PHP Method

getErrors() public method

This function will return the errors. It is extended so we can do file checks automatically.
public getErrors ( ) : string
return string
    public function getErrors()
    {
        // if the image is bigger then the allowed configuration it won't show up as filled but it is submitted
        // the empty check is added because otherwise this error is shown like 7 times
        if ($this->isSubmitted() && isset($_FILES[$this->getName()]['error']) && empty($this->errors)) {
            $imageError = $_FILES[$this->getName()]['error'];
            if ($imageError === UPLOAD_ERR_INI_SIZE && empty($this->errors)) {
                $this->addError(SpoonFilter::ucfirst(sprintf(BackendLanguage::err('FileTooBig'), Form::getUploadMaxFileSize())));
            }
        }
        return $this->errors;
    }