src/Entity/Validation/EntityDataValidator.php
public function getErrorsAsString(): string
    {
        $errors = $this->getErrors();
        if (0 === $errors->count()) {
            return '';
        }
        $message = 'found ' . $errors->count() . ' errors validating '
                   . \get_class($this->dataObject);
        foreach ($errors as $error) {
            $message .= "\n\n" . $error->getPropertyPath() . ': ' . $error->getMessage();
        }

        return $message;
    }
public function getErrorsAsString(): string
    {
        $errors = $this->getErrors();
        if (0 === $errors->count()) {
            return '';
        }
        $message = 'found ' . $errors->count() . ' errors validating '
                   . \get_class($this->dataObject);
        foreach ($errors as $error) {
            $message .= "\n\n" . $error->getPropertyPath() . ': ' . $error->getMessage();
        }

        return $message;
    }
public function getErrorsAsString ( ) : string { $ errors = $ this -> getErrors ( ) ; if ( 0 === $ errors -> count ( ) ) { return '' ; } $ message = 'found ' . $ errors -> count ( ) . ' errors validating ' . \ get_class ( $ this -> dataObject ) ; foreach ( $ errors as $ error ) { $ message .= "\n\n" . $ error -> getPropertyPath ( ) . ': ' . $ error -> getMessage ( ) ; } return $ message ; }
Perform validation and then return a message that details the number and the details of the errors

Will return an empty string if there are no errors

@return string
Perform validation and then return a message that details the number and the details of the errors