You are here

public function Stream::close in Zircon Profile 8.0

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

Closes the stream and any underlying resources.

Return value

void

Overrides StreamInterface::close

File

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

Class

Stream
Implementation of PSR HTTP streams

Namespace

Zend\Diactoros

Code

public function close() {
  if (!$this->resource) {
    return;
  }
  $resource = $this
    ->detach();
  fclose($resource);
}