src/main/php/de/codenamephp/platform/cli/question/validator/NotEmpty.php
public function validate(string $answer): string {
    if(trim((string) $answer) === '') {
      throw new \RuntimeException(sprintf('%s Given value: "%s"', $this->getErrorMessage(), $answer));
    }
    return $answer;
  }
public function validate(string $answer): string {
    if(trim((string) $answer) === '') {
      throw new \RuntimeException(sprintf('%s Given value: "%s"', $this->getErrorMessage(), $answer));
    }
    return $answer;
  }
Checks if the trimmed answer is an empty string. If so, a \RuntimeException with the error message and the value is thrown.

@param string $answer The answer to be validated
@return string The validated answer
@throws \RuntimeException if the answer is empty