Skip to content

Commit

Permalink
Break if stream fails
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Dec 3, 2022
1 parent d528e8d commit 3beda9f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ public function handle(): int
$lines = [];
$this->output->writeln('<bg=magenta;fg=white>Enter the tag values (end with an empty line):</>');
do {
$line = Str::replace(["\n", "\r"], '', fgets(STDIN));
$feed = fgets(STDIN);
if ($feed === false) {
break;
}
$line = Str::replace(["\n", "\r"], '', $feed);
if ($line === '') {
break;
}
Expand Down

0 comments on commit 3beda9f

Please sign in to comment.