Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Fixed variable type
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasvargiu authored and michalbundyra committed Dec 4, 2019
1 parent 9158ecf commit ccbbb5f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -743,21 +743,23 @@ protected function openTempStream()

if (! is_string($this->streamName)) {
// If name is not given, create temp name
/** @var string streamName */
$this->streamName = tempnam(
isset($this->config['streamtmpdir']) ? $this->config['streamtmpdir'] : sys_get_temp_dir(),
Client::class
) ?: null;
}

/** @var string streamName */
$streamName = $this->streamName;

ErrorHandler::start();
$fp = fopen($this->streamName, 'w+b');
$fp = fopen($streamName, 'w+b');
$error = ErrorHandler::stop();
if (false === $fp) {
if ($this->adapter instanceof Client\Adapter\AdapterInterface) {
$this->adapter->close();
}
throw new Exception\RuntimeException(sprintf('Could not open temp file %s', $this->streamName), 0, $error);
throw new Exception\RuntimeException(sprintf('Could not open temp file %s', $streamName), 0, $error);
}

return $fp;
Expand Down

0 comments on commit ccbbb5f

Please sign in to comment.