← All changes
|
includes/sdk/google/guzzlehttp/psr7/src/StreamWrapper.php
+15
-15
1.0.2
→
1.4.2
View file →
| @@ -1,10 +1,10 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | declare (strict_types=1); |
| 4 | -namespace Dudlewebs\WPMCS\GuzzleHttp\Psr7; | |
| 4 | +namespace Dudlewebs\WPMCS\GCP\GuzzleHttp\Psr7; | |
| 5 | 5 | |
| 6 | -use Dudlewebs\WPMCS\Psr\Http\Message\StreamInterface; | |
| 6 | +use Dudlewebs\WPMCS\GCP\Psr\Http\Message\StreamInterface; | |
| 7 | 7 | /** |
| 8 | 8 | * Converts Guzzle streams into PHP stream resources. |
| 9 | 9 | * |
| 10 | 10 | * @see https://www.php.net/streamwrapper |
| @@ -35,9 +35,9 @@ | ||
| 35 | 35 | $mode = 'w'; |
| 36 | 36 | } else { |
| 37 | 37 | throw new \InvalidArgumentException('The stream must be readable, ' . 'writable, or both.'); |
| 38 | 38 | } |
| 39 | - return fopen('guzzle://stream', $mode, \false, self::createStreamContext($stream)); | |
| 39 | + return \fopen('guzzle://stream', $mode, \false, self::createStreamContext($stream)); | |
| 40 | 40 | } |
| 41 | 41 | /** |
| 42 | 42 | * Creates a stream context that can be used to open a stream as a php stream resource. |
| 43 | 43 | * |
| @@ -44,22 +44,22 @@ | ||
| 44 | 44 | * @return resource |
| 45 | 45 | */ |
| 46 | 46 | public static function createStreamContext(StreamInterface $stream) |
| 47 | 47 | { |
| 48 | - return stream_context_create(['guzzle' => ['stream' => $stream]]); | |
| 48 | + return \stream_context_create(['guzzle' => ['stream' => $stream]]); | |
| 49 | 49 | } |
| 50 | 50 | /** |
| 51 | 51 | * Registers the stream wrapper if needed |
| 52 | 52 | */ |
| 53 | - public static function register(): void | |
| 53 | + public static function register() : void | |
| 54 | 54 | { |
| 55 | - if (!in_array('guzzle', stream_get_wrappers())) { | |
| 56 | - stream_wrapper_register('guzzle', __CLASS__); | |
| 55 | + if (!\in_array('guzzle', \stream_get_wrappers())) { | |
| 56 | + \stream_wrapper_register('guzzle', __CLASS__); | |
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | - public function stream_open(string $path, string $mode, int $options, ?string &$opened_path = null): bool | |
| 59 | + public function stream_open(string $path, string $mode, int $options, ?string &$opened_path = null) : bool | |
| 60 | 60 | { |
| 61 | - $options = stream_context_get_options($this->context); | |
| 61 | + $options = \stream_context_get_options($this->context); | |
| 62 | 62 | if (!isset($options['guzzle']['stream'])) { |
| 63 | 63 | return \false; |
| 64 | 64 | } |
| 65 | 65 | $this->mode = $mode; |
| @@ -65,25 +65,25 @@ | ||
| 65 | 65 | $this->mode = $mode; |
| 66 | 66 | $this->stream = $options['guzzle']['stream']; |
| 67 | 67 | return \true; |
| 68 | 68 | } |
| 69 | - public function stream_read(int $count): string | |
| 69 | + public function stream_read(int $count) : string | |
| 70 | 70 | { |
| 71 | 71 | return $this->stream->read($count); |
| 72 | 72 | } |
| 73 | - public function stream_write(string $data): int | |
| 73 | + public function stream_write(string $data) : int | |
| 74 | 74 | { |
| 75 | 75 | return $this->stream->write($data); |
| 76 | 76 | } |
| 77 | - public function stream_tell(): int | |
| 77 | + public function stream_tell() : int | |
| 78 | 78 | { |
| 79 | 79 | return $this->stream->tell(); |
| 80 | 80 | } |
| 81 | - public function stream_eof(): bool | |
| 81 | + public function stream_eof() : bool | |
| 82 | 82 | { |
| 83 | 83 | return $this->stream->eof(); |
| 84 | 84 | } |
| 85 | - public function stream_seek(int $offset, int $whence): bool | |
| 85 | + public function stream_seek(int $offset, int $whence) : bool | |
| 86 | 86 | { |
| 87 | 87 | $this->stream->seek($offset, $whence); |
| 88 | 88 | return \true; |
| 89 | 89 | } |
| @@ -137,9 +137,9 @@ | ||
| 137 | 137 | * blksize: int, |
| 138 | 138 | * blocks: int |
| 139 | 139 | * } |
| 140 | 140 | */ |
| 141 | - public function url_stat(string $path, int $flags): array | |
| 141 | + public function url_stat(string $path, int $flags) : array | |
| 142 | 142 | { |
| 143 | 143 | return ['dev' => 0, 'ino' => 0, 'mode' => 0, 'nlink' => 0, 'uid' => 0, 'gid' => 0, 'rdev' => 0, 'size' => 0, 'atime' => 0, 'mtime' => 0, 'ctime' => 0, 'blksize' => 0, 'blocks' => 0]; |
| 144 | 144 | } |
| 145 | 145 | } |