Skip to content

Commit

Permalink
ask() yöntemi verilen cevabı trimleyerek döndürmesi sağlandı.
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammetsafak committed Jul 6, 2022
1 parent 4b6da0e commit 05b956c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Console.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,15 @@ 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");
do {
$line = fgets($handle);
} while ($line == '');
fclose($handle);
return $line;
return trim((string)$line);
}

/**
Expand Down

0 comments on commit 05b956c

Please sign in to comment.