You are here

public function Stream::attach in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/zendframework/zend-diactoros/src/Stream.php \Zend\Diactoros\Stream::attach()

Attach a new stream/resource to the instance.

Parameters

string|resource $resource:

string $mode:

Throws

InvalidArgumentException for stream identifier that cannot be cast to a resource

InvalidArgumentException for non-resource stream

File

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

Class

Stream
Implementation of PSR HTTP streams

Namespace

Zend\Diactoros

Code

public function attach($resource, $mode = 'r') {
  $this
    ->setStream($resource, $mode);
}