Passed
Push — master ( 934a9a...abb035 )
by Melech
06:13
created
src/Valkyrja/Http/Factories/ServerFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Valkyrja/Http/Factories/RequestFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -109,11 +109,11 @@
 block discarded – undo
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)',
Please login to merge, or discard this patch.
src/Valkyrja/Http/Factories/FileFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@
 block discarded – undo
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],
Please login to merge, or discard this patch.
src/Valkyrja/Http/Factories/UriFactory.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Valkyrja/Http/Support/HeaderSecurity.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Valkyrja/Http/Streams/StreamHelpers.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/Valkyrja/Http/Streams/Stream.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/Valkyrja/Http/Models/Cookie.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -419,7 +419,7 @@
 block discarded – undo
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
             );
Please login to merge, or discard this patch.
src/Valkyrja/Http/Requests/Request.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.