function AbstractStream::readLine
File
-
vendor/
symfony/ mailer/ Transport/ Smtp/ Stream/ AbstractStream.php, line 76
Class
- AbstractStream
- A stream supporting remote sockets and local processes.
Namespace
Symfony\Component\Mailer\Transport\Smtp\StreamCode
public function readLine() : string {
if (feof($this->out)) {
return '';
}
$line = @fgets($this->out);
if ('' === $line || false === $line) {
$metas = stream_get_meta_data($this->out);
if ($metas['timed_out']) {
throw new TransportException(\sprintf('Connection to "%s" timed out.', $this->getReadConnectionDescription()));
}
if ($metas['eof']) {
throw new TransportException(\sprintf('Connection to "%s" has been closed unexpectedly.', $this->getReadConnectionDescription()));
}
if (false === $line) {
throw new TransportException(\sprintf('Unable to read from connection to "%s": ', $this->getReadConnectionDescription()) . error_get_last()['message']);
}
}
$this->debug .= \sprintf('[%s] < %s', (new \DateTimeImmutable())->format('Y-m-d\\TH:i:s.up'), $line);
return $line;
}