Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. LimitStream.php

function LimitStream::getSize

Returns the size of the limited subset of data

Overrides StreamDecoratorTrait::getSize

File

vendor/guzzlehttp/psr7/src/LimitStream.php, line 60

Class

LimitStream
Decorator used to return only a subset of a stream.

Namespace

GuzzleHttp\Psr7

Code

public function getSize() : ?int {
    if (null === ($length = $this->stream
        ->getSize())) {
        return null;
    }
    elseif ($this->limit === -1) {
        return $length - $this->offset;
    }
    else {
        return min($this->limit, $length - $this->offset);
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal