\GuzzleHttp\Psr7StreamDecoratorTrait

Stream decorator trait

Summary

Methods
Properties
Constants
__construct()
__get()
__toString()
getContents()
__call()
close()
getMetadata()
detach()
getSize()
eof()
tell()
isReadable()
isWritable()
isSeekable()
rewind()
seek()
read()
write()
$
No constants found
createStream()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$

$ : \Psr\Http\Message\StreamInterface

stream

Type

\Psr\Http\Message\StreamInterface

Methods

__get()

__get(string  $name) : \Psr\Http\Message\StreamInterface

Magic method used to create a new stream if streams are not added in the constructor of a decorator (e.g., LazyOpenStream).

Parameters

string $name

Name of the property (allows "stream" only).

Returns

\Psr\Http\Message\StreamInterface

__toString()

__toString() 

getContents()

getContents() 

__call()

__call(string  $method, array  $args) : mixed

Allow decorators to implement custom methods

Parameters

string $method

Missing method name

array $args

Method arguments

Returns

mixed

close()

close() 

getMetadata()

getMetadata(  $key = null) 

Parameters

$key

detach()

detach() 

getSize()

getSize() 

eof()

eof() 

tell()

tell() 

isReadable()

isReadable() 

isWritable()

isWritable() 

isSeekable()

isSeekable() 

rewind()

rewind() 

seek()

seek(  $offset,   $whence = SEEK_SET) 

Parameters

$offset
$whence

read()

read(  $length) 

Parameters

$length

write()

write(  $string) 

Parameters

$string

createStream()

createStream() : \Psr\Http\Message\StreamInterface

Implement in subclasses to dynamically create streams when requested.

Throws

\BadMethodCallException

Returns

\Psr\Http\Message\StreamInterface