Aggiornato Composer
This commit is contained in:
15
vendor/guzzlehttp/psr7/src/AppendStream.php
vendored
15
vendor/guzzlehttp/psr7/src/AppendStream.php
vendored
@@ -40,12 +40,14 @@ final class AppendStream implements StreamInterface
|
||||
{
|
||||
try {
|
||||
$this->rewind();
|
||||
|
||||
return $this->getContents();
|
||||
} catch (\Throwable $e) {
|
||||
if (\PHP_VERSION_ID >= 70400) {
|
||||
throw $e;
|
||||
}
|
||||
trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR);
|
||||
|
||||
return '';
|
||||
}
|
||||
}
|
||||
@@ -138,9 +140,9 @@ final class AppendStream implements StreamInterface
|
||||
|
||||
public function eof(): bool
|
||||
{
|
||||
return !$this->streams ||
|
||||
($this->current >= count($this->streams) - 1 &&
|
||||
$this->streams[$this->current]->eof());
|
||||
return !$this->streams
|
||||
|| ($this->current >= count($this->streams) - 1
|
||||
&& $this->streams[$this->current]->eof());
|
||||
}
|
||||
|
||||
public function rewind(): void
|
||||
@@ -167,7 +169,7 @@ final class AppendStream implements StreamInterface
|
||||
$stream->rewind();
|
||||
} catch (\Exception $e) {
|
||||
throw new \RuntimeException('Unable to seek stream '
|
||||
. $i . ' of the AppendStream', 0, $e);
|
||||
.$i.' of the AppendStream', 0, $e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,14 +193,13 @@ final class AppendStream implements StreamInterface
|
||||
$progressToNext = false;
|
||||
|
||||
while ($remaining > 0) {
|
||||
|
||||
// Progress to the next stream if needed.
|
||||
if ($progressToNext || $this->streams[$this->current]->eof()) {
|
||||
$progressToNext = false;
|
||||
if ($this->current === $total) {
|
||||
break;
|
||||
}
|
||||
$this->current++;
|
||||
++$this->current;
|
||||
}
|
||||
|
||||
$result = $this->streams[$this->current]->read($remaining);
|
||||
@@ -238,8 +239,6 @@ final class AppendStream implements StreamInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getMetadata($key = null)
|
||||
|
||||
Reference in New Issue
Block a user