3declare(strict_types=1);
7use Psr\Http\Message\StreamInterface;
45 if (!is_string($string)) {
46 throw new \InvalidArgumentException(
'The argument $string must be of type string but was "' . gettype($string) .
'"');
49 $stream =
new Stream(fopen(
'php://memory',
'rw'));
50 $stream->write($string);
67 if (!is_resource($resource)) {
68 throw new \InvalidArgumentException(
'The argument $resource must be of type resource but was "' . gettype($resource) .
'"');
71 return new Stream($resource);
84 $resource = $stream->
detach();
static ofPsr7Stream(StreamInterface $stream)
Create a FileStream from a Psr7 compliant stream.
ofZipResource(\ZipArchive $zip, int $index)
static ofString(string $string)
Creates a new stream with an initial value.
static ofResource($resource)
Wraps an already created resource with the stream abstraction.
Class FlySystemFileAccessTest \Provider\FlySystem @runTestsInSeparateProcesses @preserveGlobalState d...
Class ChatMainBarProvider \MainMenu\Provider.