Completed
Push — master ( 7c39f2...831177 )
by Jeroen
04:12
created

PingMessage::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Jerodev\PhpIrcClient\Messages;
4
5
use Jerodev\PhpIrcClient\IrcClient;
6
7
class PingMessage extends IrcMessage
8
{
9
    public function __construct(string $message)
10
    {
11
        parent::__construct($message);
12
    }
13
    
14
    /**
15
     *  Reply the ping message with a pong response
16
     */
17
    public function handle(IrcClient $client, bool $force = false): void
18
    {
19
        if ($this->handled && !$force) {
20
            return;
21
        }
22
        
23
        $client->sendCommand("PONG :$this->payload");
24
    }
25
}
26