@@ -42,7 +42,7 @@ |
||
42 | 42 | // This seems to be the only way to get the Authorization header on Apache |
43 | 43 | $apacheRequestHeaders = self::$apacheRequestHeaders; |
44 | 44 | |
45 | - if (isset($server['HTTP_AUTHORIZATION']) || ! is_callable($apacheRequestHeaders)) { |
|
45 | + if (isset($server['HTTP_AUTHORIZATION']) || !is_callable($apacheRequestHeaders)) { |
|
46 | 46 | return $server; |
47 | 47 | } |
48 | 48 |
@@ -109,11 +109,11 @@ |
||
109 | 109 | */ |
110 | 110 | protected static function marshalProtocolVersion(array $server): string |
111 | 111 | { |
112 | - if (! isset($server['SERVER_PROTOCOL'])) { |
|
112 | + if (!isset($server['SERVER_PROTOCOL'])) { |
|
113 | 113 | return '1.1'; |
114 | 114 | } |
115 | 115 | |
116 | - if (! preg_match('#^(HTTP/)?(?P<version>[1-9]\d*(?:\.\d)?)$#', $server['SERVER_PROTOCOL'], $matches)) { |
|
116 | + if (!preg_match('#^(HTTP/)?(?P<version>[1-9]\d*(?:\.\d)?)$#', $server['SERVER_PROTOCOL'], $matches)) { |
|
117 | 117 | throw new UnexpectedValueException( |
118 | 118 | sprintf( |
119 | 119 | 'Unrecognized protocol version (%s)', |
@@ -106,7 +106,7 @@ |
||
106 | 106 | $normalizedFiles = []; |
107 | 107 | |
108 | 108 | foreach (array_keys($files['tmp_name']) as $key) { |
109 | - $spec = [ |
|
109 | + $spec = [ |
|
110 | 110 | 'tmp_name' => $files['tmp_name'][$key], |
111 | 111 | 'size' => $files['size'][$key], |
112 | 112 | 'error' => $files['error'][$key], |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $scheme = 'https'; |
73 | 73 | } |
74 | 74 | |
75 | - if (! empty($scheme)) { |
|
75 | + if (!empty($scheme)) { |
|
76 | 76 | $uri = $uri->withScheme($scheme); |
77 | 77 | } |
78 | 78 | |
@@ -84,10 +84,10 @@ discard block |
||
84 | 84 | $host = $accumulator->host; |
85 | 85 | $port = $accumulator->port; |
86 | 86 | |
87 | - if (! empty($host)) { |
|
87 | + if (!empty($host)) { |
|
88 | 88 | $uri = $uri->withHost($host); |
89 | 89 | |
90 | - if (! empty($port)) { |
|
90 | + if (!empty($port)) { |
|
91 | 91 | $uri = $uri->withPort($port); |
92 | 92 | } |
93 | 93 | } |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | return; |
174 | 174 | } |
175 | 175 | |
176 | - if (! isset($server['SERVER_NAME'])) { |
|
176 | + if (!isset($server['SERVER_NAME'])) { |
|
177 | 177 | return; |
178 | 178 | } |
179 | 179 | |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $accumulator->port = (int) $server['SERVER_PORT']; |
184 | 184 | } |
185 | 185 | |
186 | - if (! isset($server['SERVER_ADDR']) || ! preg_match('/^\[[0-9a-fA-F\:]+\]$/', $accumulator->host)) { |
|
186 | + if (!isset($server['SERVER_ADDR']) || !preg_match('/^\[[0-9a-fA-F\:]+\]$/', $accumulator->host)) { |
|
187 | 187 | return; |
188 | 188 | } |
189 | 189 | |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | $iisUrlRewritten = self::get('IIS_WasUrlRewritten', $server); |
213 | 213 | $unencodedUrl = self::get('UNENCODED_URL', $server, ''); |
214 | 214 | |
215 | - if ('1' === $iisUrlRewritten && ! empty($unencodedUrl)) { |
|
215 | + if ('1' === $iisUrlRewritten && !empty($unencodedUrl)) { |
|
216 | 216 | return $unencodedUrl; |
217 | 217 | } |
218 | 218 |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public static function assertValid(string $value): void |
104 | 104 | { |
105 | - if (! self::isValid($value)) { |
|
105 | + if (!self::isValid($value)) { |
|
106 | 106 | throw new InvalidArgumentException(sprintf('"%s" is not valid header value', $value)); |
107 | 107 | } |
108 | 108 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | */ |
157 | 157 | public static function assertValidName(string $name): void |
158 | 158 | { |
159 | - if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/', $name)) { |
|
159 | + if (!preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/', $name)) { |
|
160 | 160 | throw new InvalidArgumentException(sprintf('"%s" is not valid header name', $name)); |
161 | 161 | } |
162 | 162 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $resource = fopen($stream, $mode); |
76 | 76 | |
77 | 77 | // If the resource isn't a resource or a stream resource type |
78 | - if (! is_resource($resource) || 'stream' !== get_resource_type($resource)) { |
|
78 | + if (!is_resource($resource) || 'stream' !== get_resource_type($resource)) { |
|
79 | 79 | // Throw a new invalid stream exception |
80 | 80 | throw new InvalidStream( |
81 | 81 | 'Invalid stream provided; must be a string stream identifier or stream resource' |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | protected function verifyWritable(): void |
150 | 150 | { |
151 | 151 | // If the stream isn't writable |
152 | - if (! $this->isWritable()) { |
|
152 | + if (!$this->isWritable()) { |
|
153 | 153 | // Throw a new runtime exception |
154 | 154 | throw new RuntimeException('Stream is not writable'); |
155 | 155 | } |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | protected function verifySeekable(): void |
180 | 180 | { |
181 | 181 | // If the stream isn't seekable |
182 | - if (! $this->isSeekable()) { |
|
182 | + if (!$this->isSeekable()) { |
|
183 | 183 | // Throw a new runtime exception |
184 | 184 | throw new RuntimeException('Stream is not seekable'); |
185 | 185 | } |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | protected function verifyReadable(): void |
223 | 223 | { |
224 | 224 | // If the stream is not readable |
225 | - if (! $this->isReadable()) { |
|
225 | + if (!$this->isReadable()) { |
|
226 | 226 | // Throw a runtime exception |
227 | 227 | throw new RuntimeException('Stream is not readable'); |
228 | 228 | } |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | public function __toString() |
218 | 218 | { |
219 | 219 | // If the stream is not readable |
220 | - if (! $this->isReadable()) { |
|
220 | + if (!$this->isReadable()) { |
|
221 | 221 | // Return an empty string |
222 | 222 | return ''; |
223 | 223 | } |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | public function getContents(): string |
354 | 354 | { |
355 | 355 | // If the stream isn't readable |
356 | - if (! $this->isReadable()) { |
|
356 | + if (!$this->isReadable()) { |
|
357 | 357 | // Throw a runtime exception |
358 | 358 | throw new RuntimeException('Stream is not readable'); |
359 | 359 | } |
@@ -419,7 +419,7 @@ |
||
419 | 419 | */ |
420 | 420 | public function setSameSite(string $sameSite = null): self |
421 | 421 | { |
422 | - if (! in_array($sameSite, [SameSite::LAX, SameSite::STRICT, null], true)) { |
|
422 | + if (!in_array($sameSite, [SameSite::LAX, SameSite::STRICT, null], true)) { |
|
423 | 423 | throw new InvalidSameSiteTypeException( |
424 | 424 | 'The "sameSite" parameter value is not valid.' |
425 | 425 | ); |
@@ -163,7 +163,7 @@ |
||
163 | 163 | ) { |
164 | 164 | $this->parsedJson = Arr::fromString((string) $this->stream); |
165 | 165 | |
166 | - if (! $parsedBody) { |
|
166 | + if (!$parsedBody) { |
|
167 | 167 | $parsedBody = $this->parsedJson; |
168 | 168 | } |
169 | 169 | } |