diff --git a/src/Protocols/Pusher/EventHandler.php b/src/Protocols/Pusher/EventHandler.php index a9c66857..9aa08e83 100644 --- a/src/Protocols/Pusher/EventHandler.php +++ b/src/Protocols/Pusher/EventHandler.php @@ -117,8 +117,8 @@ public function pong(Connection $connection): void */ public function ping(Connection $connection): void { - $connection->usesControlFrames() - ? $connection->control() + $connection->usesControlFrames() + ? $connection->control() : static::send($connection, 'ping'); $connection->ping(); diff --git a/tests/FakeConnection.php b/tests/FakeConnection.php index 9795095f..dbbd7e13 100644 --- a/tests/FakeConnection.php +++ b/tests/FakeConnection.php @@ -101,8 +101,7 @@ public function send(string $message): void /** * Send a control frame to the connection. */ - public function control(string $type = Frame::OP_PING): void { } - + public function control(string $type = Frame::OP_PING): void {} /** * Terminate a connection. diff --git a/tests/Feature/Protocols/Pusher/Reverb/ServerTest.php b/tests/Feature/Protocols/Pusher/Reverb/ServerTest.php index cc91684f..16b7a9f0 100644 --- a/tests/Feature/Protocols/Pusher/Reverb/ServerTest.php +++ b/tests/Feature/Protocols/Pusher/Reverb/ServerTest.php @@ -492,7 +492,7 @@ $subscribedAt = $managedConnection->lastSeenAt(); sleep(1); $connection->send(new Frame('', opcode: Frame::OP_PING)); - + $connection->assertPonged(); expect($managedConnection->lastSeenAt())->toBeGreaterThan($subscribedAt); }); @@ -505,7 +505,7 @@ $subscribedAt = $managedConnection->lastSeenAt(); sleep(1); $connection->send(new Frame('', opcode: Frame::OP_PONG)); - + $connection->assertNotPinged(); $connection->assertNotPonged(); expect($managedConnection->lastSeenAt())->toBeGreaterThan($subscribedAt);