• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sirn-se / websocket-php / 8346487915

19 Mar 2024 04:15PM UTC coverage: 22.584% (-77.4%) from 100.0%
8346487915

push

github

sirn-se
Temp test verification

2 of 2 new or added lines in 1 file covered. (100.0%)

742 existing lines in 32 files now uncovered.

222 of 983 relevant lines covered (22.58%)

0.23 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Middleware/PingResponder.php
1
<?php
2

3
/**
4
 * Copyright (C) 2014-2024 Textalk and contributors.
5
 * This file is part of Websocket PHP and is free software under the ISC License.
6
 */
7

8
namespace WebSocket\Middleware;
9

10
use Psr\Log\{
11
    LoggerAwareInterface,
12
    LoggerAwareTrait
13
};
14
use Stringable;
15
use WebSocket\Connection;
16
use WebSocket\Message\{
17
    Ping,
18
    Pong,
19
    Message
20
};
21
use WebSocket\Trait\StringableTrait;
22

23
/**
24
 * WebSocket\Middleware\PingResponder class.
25
 * Responds on incoming ping messages.
26
 */
27
class PingResponder implements LoggerAwareInterface, ProcessIncomingInterface, Stringable
28
{
29
    use StringableTrait;
30
    use LoggerAwareTrait;
31

32
    public function processIncoming(ProcessStack $stack, Connection $connection): Message
33
    {
UNCOV
34
        $message = $stack->handleIncoming();
×
UNCOV
35
        if ($message instanceof Ping && $connection->isWritable()) {
×
UNCOV
36
            $connection->send(new Pong($message->getContent()));
×
37
        }
UNCOV
38
        return $message;
×
39
    }
40
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc