mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-02-17 11:10:22 +00:00
Initial import
This commit is contained in:
commit
2295a33590
884 changed files with 93939 additions and 0 deletions
26
php/vendor/http-interop/http-factory-guzzle/src/StreamFactory.php
vendored
Normal file
26
php/vendor/http-interop/http-factory-guzzle/src/StreamFactory.php
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
namespace Http\Factory\Guzzle;
|
||||
|
||||
use GuzzleHttp\Psr7\Stream;
|
||||
use GuzzleHttp\Psr7\Utils;
|
||||
use Psr\Http\Message\StreamFactoryInterface;
|
||||
use Psr\Http\Message\StreamInterface;
|
||||
|
||||
class StreamFactory implements StreamFactoryInterface
|
||||
{
|
||||
public function createStream(string $content = ''): StreamInterface
|
||||
{
|
||||
return Utils::streamFor($content);
|
||||
}
|
||||
|
||||
public function createStreamFromFile(string $file, string $mode = 'r'): StreamInterface
|
||||
{
|
||||
return $this->createStreamFromResource(Utils::tryFopen($file, $mode));
|
||||
}
|
||||
|
||||
public function createStreamFromResource($resource): StreamInterface
|
||||
{
|
||||
return new Stream($resource);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue