GuzzleHttp\Psr7\LimitStream::eof PHP Method

eof() public method

public eof ( )
    public function eof()
    {
        // Always return true if the underlying stream is EOF
        if ($this->stream->eof()) {
            return true;
        }
        // No limit and the underlying stream is not at EOF
        if ($this->limit == -1) {
            return false;
        }
        return $this->stream->tell() >= $this->offset + $this->limit;
    }

Usage Example

Example #1
0
 public function testClaimsConsumedWhenReadLimitIsReached()
 {
     $this->assertFalse($this->body->eof());
     $this->body->read(1000);
     $this->assertTrue($this->body->eof());
 }