Completed
Push — master ( 6faa20...05d108 )
by Melech
04:48
created
src/Valkyrja/ORM/Retrievers/Retriever.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -349,7 +349,7 @@
 block discarded – undo
349 349
      */
350 350
     protected function validateId($id): void
351 351
     {
352
-        if (! is_string($id) && ! is_int($id)) {
352
+        if (!is_string($id) && !is_int($id)) {
353 353
             throw new InvalidArgumentException('ID should be an int or string only.');
354 354
         }
355 355
     }
Please login to merge, or discard this patch.
src/Valkyrja/ORM/Adapters/PDOAdapter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@
 block discarded – undo
120 120
      */
121 121
     public function ensureTransaction(): void
122 122
     {
123
-        if (! $this->inTransaction()) {
123
+        if (!$this->inTransaction()) {
124 124
             $this->beginTransaction();
125 125
         }
126 126
     }
Please login to merge, or discard this patch.
src/Valkyrja/ORM/QueryBuilders/SqlQueryBuilder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -528,7 +528,7 @@
 block discarded – undo
528 528
             return ':' . $column;
529 529
         }
530 530
 
531
-        if (! is_array($value)) {
531
+        if (!is_array($value)) {
532 532
             return (string) $value;
533 533
         }
534 534
 
Please login to merge, or discard this patch.
src/Valkyrja/ORM/Repositories/Repository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -468,7 +468,7 @@
 block discarded – undo
468 468
      */
469 469
     protected function validateEntity(Entity $entity): void
470 470
     {
471
-        if (! ($entity instanceof $this->entity)) {
471
+        if (!($entity instanceof $this->entity)) {
472 472
             throw new InvalidEntityException(
473 473
                 'This repository expects entities to be instances of '
474 474
                 . $this->entity
Please login to merge, or discard this patch.
src/Valkyrja/ORM/Providers/ServiceProvider.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
     {
128 128
         $container->setClosure(
129 129
             Driver::class,
130
-            static function (array $config, string $adapter) use ($container): Driver {
130
+            static function(array $config, string $adapter) use ($container): Driver {
131 131
                 return new Driver(
132 132
                     $container,
133 133
                     $adapter,
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
     {
149 149
         $container->setClosure(
150 150
             PDODriver::class,
151
-            static function (array $config, string $adapter) use ($container): PDODriver {
151
+            static function(array $config, string $adapter) use ($container): PDODriver {
152 152
                 return new PDODriver(
153 153
                     $container,
154 154
                     $adapter,
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
     {
170 170
         $container->setClosure(
171 171
             MySqlDriver::class,
172
-            static function (array $config, string $adapter) use ($container): MySqlDriver {
172
+            static function(array $config, string $adapter) use ($container): MySqlDriver {
173 173
                 return new MySqlDriver(
174 174
                     $container,
175 175
                     $adapter,
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
     {
191 191
         $container->setClosure(
192 192
             PgSqlDriver::class,
193
-            static function (array $config, string $adapter) use ($container): PgSqlDriver {
193
+            static function(array $config, string $adapter) use ($container): PgSqlDriver {
194 194
                 return new PgSqlDriver(
195 195
                     $container,
196 196
                     $adapter,
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 
214 214
         $container->setClosure(
215 215
             PDOAdapter::class,
216
-            static function (array $config) use ($container, $orm) {
216
+            static function(array $config) use ($container, $orm) {
217 217
                 return new PDOAdapter(
218 218
                     $container,
219 219
                     $orm,
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 
243 243
         $container->setClosure(
244 244
             Repository::class,
245
-            static function (string $entity) use ($orm): Repository {
245
+            static function(string $entity) use ($orm): Repository {
246 246
                 return new Repository(
247 247
                     $orm,
248 248
                     $entity
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 
266 266
         $container->setClosure(
267 267
             CacheRepository::class,
268
-            static function (string $entity) use ($orm, $cache): CacheRepository {
268
+            static function(string $entity) use ($orm, $cache): CacheRepository {
269 269
                 return new CacheRepository(
270 270
                     $orm,
271 271
                     $cache,
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
     {
287 287
         $container->setClosure(
288 288
             Persister::class,
289
-            static function (Adapter $adapter): Persister {
289
+            static function(Adapter $adapter): Persister {
290 290
                 return new \Valkyrja\ORM\Persisters\Persister(
291 291
                     $adapter
292 292
                 );
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
     {
306 306
         $container->setClosure(
307 307
             Retriever::class,
308
-            static function (Adapter $adapter): Retriever {
308
+            static function(Adapter $adapter): Retriever {
309 309
                 return new \Valkyrja\ORM\Retrievers\Retriever(
310 310
                     $adapter
311 311
                 );
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
     {
325 325
         $container->setClosure(
326 326
             Query::class,
327
-            static function (Adapter $adapter): Query {
327
+            static function(Adapter $adapter): Query {
328 328
                 return new \Valkyrja\ORM\Queries\Query(
329 329
                     $adapter
330 330
                 );
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
     {
344 344
         $container->setClosure(
345 345
             QueryBuilder::class,
346
-            static function (Adapter $adapter): QueryBuilder {
346
+            static function(Adapter $adapter): QueryBuilder {
347 347
                 return new SqlQueryBuilder(
348 348
                     $adapter
349 349
                 );
Please login to merge, or discard this patch.
src/Valkyrja/SMS/Providers/ServiceProvider.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     {
108 108
         $container->setClosure(
109 109
             Nexmo::class,
110
-            static function (array $config): Nexmo {
110
+            static function(array $config): Nexmo {
111 111
                 return new Nexmo(
112 112
                     new Basic($config['username'], $config['password'])
113 113
                 );
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 
130 130
         $container->setClosure(
131 131
             LogAdapter::class,
132
-            static function (array $config) use ($logger): LogAdapter {
132
+            static function(array $config) use ($logger): LogAdapter {
133 133
                 return new LogAdapter(
134 134
                     $logger->useLogger($config['logger'] ?? null),
135 135
                     $config
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
     {
150 150
         $container->setClosure(
151 151
             NexmoAdapter::class,
152
-            static function (array $config) use ($container): NexmoAdapter {
152
+            static function(array $config) use ($container): NexmoAdapter {
153 153
                 return new NexmoAdapter(
154 154
                     $container->get(Nexmo::class, [$config])
155 155
                 );
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
     {
169 169
         $container->setClosure(
170 170
             NullAdapter::class,
171
-            static function (array $config): NullAdapter {
171
+            static function(array $config): NullAdapter {
172 172
                 return new NullAdapter(
173 173
                     $config
174 174
                 );
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
     {
188 188
         $container->setClosure(
189 189
             Message::class,
190
-            static function (array $config): Message {
190
+            static function(array $config): Message {
191 191
                 return (new Message())->setFrom($config['fromName']);
192 192
             }
193 193
         );
Please login to merge, or discard this patch.
src/Valkyrja/Http/Files/UploadedFile.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 
239 239
         // If the target directory is not a directory
240 240
         // or the target directory is not writable
241
-        if (! is_dir($targetDirectory) || ! is_writable($targetDirectory)) {
241
+        if (!is_dir($targetDirectory) || !is_writable($targetDirectory)) {
242 242
             // Throw a runtime exception
243 243
             throw new RuntimeException(
244 244
                 sprintf('The target directory `%s` does not exists or is not writable', $targetDirectory)
@@ -250,13 +250,13 @@  discard block
 block discarded – undo
250 250
         // If the PHP_SAPI value is empty
251 251
         // or there is no file
252 252
         // or the PHP_SAPI value is set to a CLI environment
253
-        if (empty($sapi) || ! $this->file || 0 === strpos($sapi, 'cli')) {
253
+        if (empty($sapi) || !$this->file || 0 === strpos($sapi, 'cli')) {
254 254
             // Non-SAPI environment, or no filename present
255 255
             $this->writeStream($targetPath);
256 256
         }
257 257
         // Otherwise try to use the move_uploaded_file function
258 258
         // and if the move_uploaded_file function call failed
259
-        elseif (! move_uploaded_file($this->file, $targetPath)) {
259
+        elseif (!move_uploaded_file($this->file, $targetPath)) {
260 260
             // Throw a runtime exception
261 261
             throw new RuntimeException('Error occurred while moving uploaded file');
262 262
         }
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
         $stream->rewind();
354 354
 
355 355
         // While the end of file hasn't been reached
356
-        while (! $stream->eof()) {
356
+        while (!$stream->eof()) {
357 357
             // Write the stream's contents to the handler
358 358
             fwrite($handle, $stream->read(4096));
359 359
         }
Please login to merge, or discard this patch.
src/Valkyrja/Http/Messages/MessageTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
      */
178 178
     public function getHeader(string $name): array
179 179
     {
180
-        if (! $this->hasHeader($name)) {
180
+        if (!$this->hasHeader($name)) {
181 181
             return [];
182 182
         }
183 183
 
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
     {
273 273
         HeaderSecurity::assertValidName($name);
274 274
 
275
-        if (! $this->hasHeader($name)) {
275
+        if (!$this->hasHeader($name)) {
276 276
             return $this->withHeader($name);
277 277
         }
278 278
 
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
      */
301 301
     public function withoutHeader(string $name): self
302 302
     {
303
-        if (! $this->hasHeader($name)) {
303
+        if (!$this->hasHeader($name)) {
304 304
             return clone $this;
305 305
         }
306 306
 
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
     {
359 359
         // HTTP/1 uses a "<major>.<minor>" numbering scheme to indicate
360 360
         // versions of the protocol, while HTTP/2 does not.
361
-        if (! preg_match('#^(1\.[01]|2)$#', $version)) {
361
+        if (!preg_match('#^(1\.[01]|2)$#', $version)) {
362 362
             throw new InvalidProtocolVersion(
363 363
                 sprintf(
364 364
                     'Unsupported HTTP protocol version "%s" provided',
Please login to merge, or discard this patch.
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.