in src/io/BufferedReader.php [165:182]
public async function readLineAsync(): Awaitable<?string> {
try {
$line = await $this->readUntilAsync("\n");
} catch (OS\ErrnoException $ex) {
if ($ex->getErrno() === OS\Errno::EBADF) {
// Eg foreach ($stdin->linesIterator()) when stdin is closed
return null;
}
throw $ex;
}
if ($line !== null) {
return $line;
}
$line = await $this->readAllAsync();
return $line === '' ? null : $line;
}