You are here

public function Stream::isReadable in Zircon Profile 8

Same name in this branch
  1. 8 vendor/zendframework/zend-diactoros/src/Stream.php \Zend\Diactoros\Stream::isReadable()
  2. 8 vendor/guzzlehttp/psr7/src/Stream.php \GuzzleHttp\Psr7\Stream::isReadable()
  3. 8 vendor/symfony/psr-http-message-bridge/Tests/Fixtures/Stream.php \Symfony\Bridge\PsrHttpMessage\Tests\Fixtures\Stream::isReadable()
Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-diactoros/src/Stream.php \Zend\Diactoros\Stream::isReadable()

Returns whether or not the stream is readable.

Return value

bool

Overrides StreamInterface::isReadable

3 calls to Stream::isReadable()
Stream::getContents in vendor/zendframework/zend-diactoros/src/Stream.php
Returns the remaining contents in a string
Stream::read in vendor/zendframework/zend-diactoros/src/Stream.php
Read data from the stream.
Stream::__toString in vendor/zendframework/zend-diactoros/src/Stream.php
Reads all data from the stream into a string, from the beginning to end.

File

vendor/zendframework/zend-diactoros/src/Stream.php, line 225

Class

Stream
Implementation of PSR HTTP streams

Namespace

Zend\Diactoros

Code

public function isReadable() {
  if (!$this->resource) {
    return false;
  }
  $meta = stream_get_meta_data($this->resource);
  $mode = $meta['mode'];
  return strstr($mode, 'r') || strstr($mode, '+');
}