@@ -33,10 +33,10 @@ |
||
| 33 | 33 | $resource = @\fopen($filename, $mode); |
| 34 | 34 | if (false === $resource) { |
| 35 | 35 | if ('' === $mode || false === \in_array($mode[0], ['r', 'w', 'a', 'x', 'c'])) { |
| 36 | - throw new \InvalidArgumentException('The mode ' . $mode . ' is invalid.'); |
|
| 36 | + throw new \InvalidArgumentException('The mode '.$mode.' is invalid.'); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - throw new \RuntimeException('The file ' . $filename . ' cannot be opened.'); |
|
| 39 | + throw new \RuntimeException('The file '.$filename.' cannot be opened.'); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | return Stream::create($resource); |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $target = '/'; |
| 35 | 35 | } |
| 36 | 36 | if ('' !== $this->uri->getQuery()) { |
| 37 | - $target .= '?' . $this->uri->getQuery(); |
|
| 37 | + $target .= '?'.$this->uri->getQuery(); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | return $target; |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | if (null !== ($port = $this->uri->getPort())) { |
| 100 | - $host .= ':' . $port; |
|
| 100 | + $host .= ':'.$port; |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | if (isset($this->headerNames['host'])) { |
@@ -183,7 +183,7 @@ |
||
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | if (-1 === \fseek($this->stream, $offset, $whence)) { |
| 186 | - throw new \RuntimeException('Unable to seek to stream position ' . $offset . ' with whence ' . \var_export($whence, true)); |
|
| 186 | + throw new \RuntimeException('Unable to seek to stream position '.$offset.' with whence '.\var_export($whence, true)); |
|
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $this->query = isset($parts['query']) ? $this->filterQueryAndFragment($parts['query']) : ''; |
| 61 | 61 | $this->fragment = isset($parts['fragment']) ? $this->filterQueryAndFragment($parts['fragment']) : ''; |
| 62 | 62 | if (isset($parts['pass'])) { |
| 63 | - $this->userInfo .= ':' . $parts['pass']; |
|
| 63 | + $this->userInfo .= ':'.$parts['pass']; |
|
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | } |
@@ -83,11 +83,11 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | $authority = $this->host; |
| 85 | 85 | if ('' !== $this->userInfo) { |
| 86 | - $authority = $this->userInfo . '@' . $authority; |
|
| 86 | + $authority = $this->userInfo.'@'.$authority; |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | if (null !== $this->port) { |
| 90 | - $authority .= ':' . $this->port; |
|
| 90 | + $authority .= ':'.$this->port; |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | return $authority; |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | { |
| 145 | 145 | $info = $user; |
| 146 | 146 | if (null !== $password && '' !== $password) { |
| 147 | - $info .= ':' . $password; |
|
| 147 | + $info .= ':'.$password; |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | if ($this->userInfo === $info) { |
@@ -228,24 +228,24 @@ discard block |
||
| 228 | 228 | { |
| 229 | 229 | $uri = ''; |
| 230 | 230 | if ('' !== $scheme) { |
| 231 | - $uri .= $scheme . ':'; |
|
| 231 | + $uri .= $scheme.':'; |
|
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | if ('' !== $authority) { |
| 235 | - $uri .= '//' . $authority; |
|
| 235 | + $uri .= '//'.$authority; |
|
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | if ('' !== $path) { |
| 239 | 239 | if ('/' !== $path[0]) { |
| 240 | 240 | if ('' !== $authority) { |
| 241 | 241 | // If the path is rootless and an authority is present, the path MUST be prefixed by "/" |
| 242 | - $path = '/' . $path; |
|
| 242 | + $path = '/'.$path; |
|
| 243 | 243 | } |
| 244 | 244 | } elseif (isset($path[1]) && '/' === $path[1]) { |
| 245 | 245 | if ('' === $authority) { |
| 246 | 246 | // If the path is starting with more than one "/" and no authority is present, the |
| 247 | 247 | // starting slashes MUST be reduced to one. |
| 248 | - $path = '/' . \ltrim($path, '/'); |
|
| 248 | + $path = '/'.\ltrim($path, '/'); |
|
| 249 | 249 | } |
| 250 | 250 | } |
| 251 | 251 | |
@@ -253,11 +253,11 @@ discard block |
||
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | if ('' !== $query) { |
| 256 | - $uri .= '?' . $query; |
|
| 256 | + $uri .= '?'.$query; |
|
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | if ('' !== $fragment) { |
| 260 | - $uri .= '#' . $fragment; |
|
| 260 | + $uri .= '#'.$fragment; |
|
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | return $uri; |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | throw new \InvalidArgumentException('Path must be a string'); |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | - return \preg_replace_callback('/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\/]++|%(?![A-Fa-f0-9]{2}))/', [__CLASS__, 'rawurlencodeMatchZero'], $path); |
|
| 294 | + return \preg_replace_callback('/(?:[^'.self::CHAR_UNRESERVED.self::CHAR_SUB_DELIMS.'%:@\/]++|%(?![A-Fa-f0-9]{2}))/', [__CLASS__, 'rawurlencodeMatchZero'], $path); |
|
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | private function filterQueryAndFragment($str): string |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | throw new \InvalidArgumentException('Query and fragment must be a string'); |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | - return \preg_replace_callback('/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/', [__CLASS__, 'rawurlencodeMatchZero'], $str); |
|
| 303 | + return \preg_replace_callback('/(?:[^'.self::CHAR_UNRESERVED.self::CHAR_SUB_DELIMS.'%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/', [__CLASS__, 'rawurlencodeMatchZero'], $str); |
|
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | private static function rawurlencodeMatchZero(array $match): string |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | private $stream; |
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | - * @param StreamInterface|string|resource $streamOrFile |
|
| 50 | + * @param \Psr\Http\Message\StreamInterface $streamOrFile |
|
| 51 | 51 | * @param int $size |
| 52 | 52 | * @param int $errorStatus |
| 53 | 53 | * @param string|null $clientFilename |