public function getAllErrors() : array
    {
        $errors = $this->getErrors();

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

        return $errors;
    }
public function getAllErrors() : array
    {
        $errors = $this->getErrors();

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

        return $errors;
    }
public function getAllErrors ( ) : array { $ errors = $ this -> getErrors ( ) ; foreach ( $ this -> components as $ component ) { $ errors = array_merge ( $ errors , $ component -> getErrors ( ) ) ; } return $ errors ; }
Returns all form-level errors and component-level errors.

@return string[]
Returns all form - level errors and component - level errors .