diff --git a/src/Console.php b/src/Console.php index 8236f22..4f50870 100644 --- a/src/Console.php +++ b/src/Console.php @@ -208,7 +208,7 @@ public function flags(): array return $this->flags; } - public function ask(string $question) + public function ask(string $question): string { $this->message( \PHP_EOL . $question . \PHP_EOL); $handle = fopen("php://stdin", "r"); @@ -216,7 +216,7 @@ public function ask(string $question) $line = fgets($handle); } while ($line == ''); fclose($handle); - return $line; + return trim((string)$line); } /**