فهرست منبع

Merge pull request #932 from joanhey/new--

Small changes
walkor 2 سال پیش
والد
کامیت
a2c25385f1
4فایلهای تغییر یافته به همراه6 افزوده شده و 5 حذف شده
  1. 1 1
      .github/workflows/test.yml
  2. 1 1
      composer.json
  3. 2 1
      src/Connection/TcpConnection.php
  4. 2 2
      src/Events/Select.php

+ 1 - 1
.github/workflows/test.yml

@@ -43,7 +43,7 @@ jobs:
           command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress
 
       - name: Static analysis
-        run: composer analyse
+        run: composer analyze
 
       - name: Execute tests
         run: vendor/bin/pest --coverage --colors=always

+ 1 - 1
composer.json

@@ -53,6 +53,6 @@
         }
     },
     "scripts": {
-        "analyse": "phpstan"
+        "analyze": "phpstan"
     }
 }

+ 2 - 1
src/Connection/TcpConnection.php

@@ -819,7 +819,8 @@ class TcpConnection extends ConnectionInterface implements JsonSerializable
         if (false === $ret) {
             $this->destroy();
             return false;
-        } elseif (0 === $ret) {
+        }
+        if (0 === $ret) {
             // There isn't enough data and should try again.
             return 0;
         }

+ 2 - 2
src/Events/Select.php

@@ -116,7 +116,7 @@ class Select implements EventInterface
     /**
      * @var ?callable
      */
-    protected $errorHandler = null;
+    protected $errorHandler;
 
     /**
      * Construct.
@@ -276,7 +276,7 @@ class Select implements EventInterface
             return;
         }
         $this->signalEvents[$signal] = $func;
-        pcntl_signal($signal, [$this, 'signalHandler']);
+        pcntl_signal($signal, $this->signalHandler(...));
     }
 
     /**