update patch 1
This commit is contained in:
@@ -37,9 +37,9 @@ abstract class AbstractStream
|
||||
public function write(string $bytes, bool $debug = true): void
|
||||
{
|
||||
if ($debug) {
|
||||
$timestamp = date('c');
|
||||
$timestamp = (new \DateTimeImmutable())->format('Y-m-d\TH:i:s.up');
|
||||
foreach (explode("\n", trim($bytes)) as $line) {
|
||||
$this->debug .= sprintf("[%s] > %s\n", $timestamp, $line);
|
||||
$this->debug .= \sprintf("[%s] > %s\n", $timestamp, $line);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,17 +83,17 @@ abstract class AbstractStream
|
||||
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()));
|
||||
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()));
|
||||
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']);
|
||||
throw new TransportException(\sprintf('Unable to read from connection to "%s": ', $this->getReadConnectionDescription()).error_get_last()['message']);
|
||||
}
|
||||
}
|
||||
|
||||
$this->debug .= sprintf('[%s] < %s', date('c'), $line);
|
||||
$this->debug .= \sprintf('[%s] < %s', (new \DateTimeImmutable())->format('Y-m-d\TH:i:s.up'), $line);
|
||||
|
||||
return $line;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user