Skip to content

Commit 0321cc0

Browse files
committed
fix: TypeError in InputOutput::input()
1 parent 6767da7 commit 0321cc0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

system/CLI/InputOutput.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,13 @@ public function input(?string $prefix = null): string
4848

4949
echo $prefix;
5050

51-
return fgets(fopen('php://stdin', 'rb'));
51+
$input = fgets(fopen('php://stdin', 'rb'));
52+
53+
if ($input === false) {
54+
$input = '';
55+
}
56+
57+
return $input;
5258
}
5359

5460
/**

0 commit comments

Comments
 (0)