Skip to content

Commit

Permalink
fix: Validates user input has no spaces
Browse files Browse the repository at this point in the history
As of right now I can not see any reason to allow spaces in user input
for ANY of the fields (not just those in the `.env`).

Closes #13
Ref: Issue #5
  • Loading branch information
poppabear8883 committed Aug 15, 2018
1 parent b9a0452 commit 007fea9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Traits/ConsoleTools.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ protected function question($question, $default = '')
do {
$answer = $this->io->ask($question, $default);

$valid = ($answer !== '');
$valid = ($answer !== '' && strpos($answer, ' ') === false);

if (!$valid) {
$this->warning('Cannot be empty!');
$this->warning('Cannot be empty or contain spaces!');
}

} while (!$valid);

return $answer;
return trim($answer);
}
}

0 comments on commit 007fea9

Please sign in to comment.