Passed
Push — master ( be8069...14083c )
by Shiyu
02:14
created
src/Connections.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
         }
223 223
 
224 224
         // checking in getWaitQ
225
-        while (($this->getWaitQ ?! $this->getWaitQ->isEmpty() : false) && $wait = $this->getWaitQ->dequeue()) {
225
+        while (($this->getWaitQ ? !$this->getWaitQ->isEmpty() : false) && $wait = $this->getWaitQ->dequeue()) {
226 226
             if ($wait->pended()) {
227 227
                 $wait->resolve($this->setBusying($conn));
228 228
                 return;
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
      */
276 276
     private function checking() : void
277 277
     {
278
-        $cleared = ! ($this->cIdleCount() + $this->cBusyCount());
278
+        $cleared = !($this->cIdleCount() + $this->cBusyCount());
279 279
 
280 280
         if ($this->exiting) {
281 281
             if ($this->pool && ($closed = $this->pool->closed())->pended() && $cleared) {
@@ -317,8 +317,8 @@  discard block
 block discarded – undo
317 317
                 ]
318 318
             );
319 319
             $this->rsExpanding = $expandSize = $target - $busySize - $idleSize;
320
-            while ($expandSize -- > 0) {
321
-                go(function () {
320
+            while ($expandSize-- > 0) {
321
+                go(function() {
322 322
                     try {
323 323
                         /**
324 324
                          * @var Poolable $poolable
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
                             ]
337 337
                         );
338 338
                     } finally {
339
-                        $this->rsExpanding --;
339
+                        $this->rsExpanding--;
340 340
                     }
341 341
                 });
342 342
             }
@@ -353,9 +353,9 @@  discard block
 block discarded – undo
353 353
                 ]
354 354
             );
355 355
             $shrinkSize = ($busySize + $idleSize) - $target;
356
-            while ($shrinkSize -- > 0) {
356
+            while ($shrinkSize-- > 0) {
357 357
                 if ($this->staIdling->count() > 0) {
358
-                    if ($this->removeIdling(null, function ($_, Poolable $found) use ($forced) {
358
+                    if ($this->removeIdling(null, function($_, Poolable $found) use ($forced) {
359 359
                         if (($this->recycling && $this->recycling->idling($found->cid())) || $forced) {
360 360
                             return true;
361 361
                         }
@@ -369,12 +369,12 @@  discard block
 block discarded – undo
369 369
                         break;
370 370
                     }
371 371
                 }
372
-                ($closer = Promise::deferred())->then(function (Poolable $conn) {
372
+                ($closer = Promise::deferred())->then(function(Poolable $conn) {
373 373
                     $this->setClosing($conn);
374 374
                 });
375 375
                 ($got = array_shift($this->staBusying)) && $got->schedule(Poolable::RELEASED, $closer);
376 376
             }
377
-            return - $shrinkSize;
377
+            return -$shrinkSize;
378 378
         }
379 379
 
380 380
         return 0;
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
         }
434 434
 
435 435
         if (is_null($matcher)) {
436
-            $matcher = static function (Poolable $present, Poolable $found) {
436
+            $matcher = static function(Poolable $present, Poolable $found) {
437 437
                 return $present->cid() === $found->cid();
438 438
             };
439 439
         }
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
         $searched = 0;
442 442
         $connections = $this->staIdling->count();
443 443
 
444
-        while ($searched ++ < $connections) {
444
+        while ($searched++ < $connections) {
445 445
             $conn = $this->staIdling->pop();
446 446
             if ($matcher($any, $conn)) {
447 447
                 $close && $this->setClosing($conn);
Please login to merge, or discard this patch.