summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorValentin V / vvval <[email protected]>2020-05-13 10:19:21 +0300
committerValentin V / vvval <[email protected]>2020-05-13 10:19:21 +0300
commitd0910d5ba44f60eda655d87fd4587164b31a5927 (patch)
treec86f57bc057bdcc75f0f8d0561ce9b4bd895b9ad /src
parent8fd8356ef1cb9b7602e511cf0d59964cdbbe5dbe (diff)
WIP: fix phpstan based on new goridge interface
Diffstat (limited to 'src')
-rw-r--r--src/Worker.php11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/Worker.php b/src/Worker.php
index 2da16e86..d509562e 100644
--- a/src/Worker.php
+++ b/src/Worker.php
@@ -11,8 +11,7 @@ namespace Spiral\RoadRunner;
use Spiral\Goridge\Exceptions\GoridgeException;
use Spiral\Goridge\RelayInterface as Relay;
-use Spiral\Goridge\SocketRelay;
-use Spiral\Goridge\StreamRelay;
+use Spiral\Goridge\SendPackageRelayInterface;
use Spiral\RoadRunner\Exception\RoadRunnerException;
/**
@@ -30,19 +29,15 @@ class Worker
// Send as response context to request worker termination
public const STOP = '{"stop":true}';
- /** @var Relay|StreamRelay|SocketRelay */
+ /** @var Relay */
private $relay;
- /** @var bool */
- private $optimizedRelay;
-
/**
* @param Relay $relay
*/
public function __construct(Relay $relay)
{
$this->relay = $relay;
- $this->optimizedRelay = method_exists($relay, 'sendPackage');
}
/**
@@ -89,7 +84,7 @@ class Worker
*/
public function send(string $payload = null, string $header = null): void
{
- if (!$this->optimizedRelay) {
+ if (!$this->relay instanceof SendPackageRelayInterface) {
if ($header === null) {
$this->relay->send('', Relay::PAYLOAD_CONTROL | Relay::PAYLOAD_NONE);
} else {