Skip to content

Commit 05b956c

Browse files
committed
ask() yöntemi verilen cevabı trimleyerek döndürmesi sağlandı.
1 parent 4b6da0e commit 05b956c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/Console.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -208,15 +208,15 @@ public function flags(): array
208208
return $this->flags;
209209
}
210210

211-
public function ask(string $question)
211+
public function ask(string $question): string
212212
{
213213
$this->message( \PHP_EOL . $question . \PHP_EOL);
214214
$handle = fopen("php://stdin", "r");
215215
do {
216216
$line = fgets($handle);
217217
} while ($line == '');
218218
fclose($handle);
219-
return $line;
219+
return trim((string)$line);
220220
}
221221

222222
/**

0 commit comments

Comments
 (0)