GuzzleHttp\Psr7\LimitStream::tell PHP Метод

tell() публичный Метод

Give a relative tell() {@inheritdoc}
public tell ( )
    public function tell()
    {
        return $this->stream->tell() - $this->offset;
    }

Usage Example

Пример #1
0
 public function testAllowsBoundedSeek()
 {
     $this->body->seek(100);
     $this->assertEquals(10, $this->body->tell());
     $this->assertEquals(13, $this->decorated->tell());
     $this->body->seek(0);
     $this->assertEquals(0, $this->body->tell());
     $this->assertEquals(3, $this->decorated->tell());
     try {
         $this->body->seek(-10);
         $this->fail();
     } catch (\RuntimeException $e) {
     }
     $this->assertEquals(0, $this->body->tell());
     $this->assertEquals(3, $this->decorated->tell());
     $this->body->seek(5);
     $this->assertEquals(5, $this->body->tell());
     $this->assertEquals(8, $this->decorated->tell());
     // Fail
     try {
         $this->body->seek(1000, SEEK_END);
         $this->fail();
     } catch (\RuntimeException $e) {
     }
 }