function Stream::getSize
Same name in this branch
- 11.1.x vendor/symfony/http-foundation/File/Stream.php \Symfony\Component\HttpFoundation\File\Stream::getSize()
Overrides StreamInterface::getSize
File
-
vendor/
guzzlehttp/ psr7/ src/ Stream.php, line 132
Class
- Stream
- PHP stream implementation.
Namespace
GuzzleHttp\Psr7Code
public function getSize() : ?int {
if ($this->size !== null) {
return $this->size;
}
if (!isset($this->stream)) {
return null;
}
// Clear the stat cache if the stream has a URI
if ($this->uri) {
clearstatcache(true, $this->uri);
}
$stats = fstat($this->stream);
if (is_array($stats) && isset($stats['size'])) {
$this->size = $stats['size'];
return $this->size;
}
return null;
}