src/Exceptions/SaveFailedException.php
private function formatErrors($errors)
    {
        if ($errors) {
            $errors = trim($errors);

            if (in_array(substr($errors, -1), ['.', '!', '?'], true)) {
                return $errors;
            }

            return $errors.'.';
        }
    }
private function formatErrors($errors)
    {
        if ($errors) {
            $errors = trim($errors);

            if (in_array(substr($errors, -1), ['.', '!', '?'], true)) {
                return $errors;
            }

            return $errors.'.';
        }
    }
private function formatErrors ( $ errors ) { if ( $ errors ) { $ errors = trim ( $ errors ) ; if ( in_array ( substr ( $ errors , - 1 ) , [ '.' , '!' , '?' ] , true ) ) { return $ errors ; } return $ errors . '.' ; } }
Format the given errors correctly.

We're stripping any trailing whitespace, and ensuring they end in a
punctuation character. If null is passed, then null is returned also.

@param string|null $errors

@return string|null
Format the given errors correctly .