StreamFactory Class

Aurora\Http\Factory Namespace

Interfaces

  • I StreamFactoryInterface

Methods

createStream

Create a new stream from a string

Parameters

  • string $content — String content with which to populate the stream

Return Value

  • \StreamInterface

Signature

public function createStream(string $content = ''): Psr\Http\Message\StreamInterface

createStreamFromFile

Create a stream from an existing file

Parameters

  • string $filename — Filename or stream URI to use as basis of stream
  • string $mode — Mode with which to open the underlying filename/stream

Return Value

  • \StreamInterface

Signature

public function createStreamFromFile(string $filename, string $mode = 'r'): Psr\Http\Message\StreamInterface

createStreamFromResource

Create a new stream from an existing resource

Parameters

  • mixed $resource — PHP resource to use as basis of stream

Return Value

  • \StreamInterface

Signature

public function createStreamFromResource(mixed $resource): Psr\Http\Message\StreamInterface

Go to top