Completed
Push — master ( f445a9...55498a )
by Camilo
02:27
created

PingReq::shouldExpectAnswer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace unreal4u\MQTT\Protocol;
6
7
use unreal4u\MQTT\Internals\ProtocolBase;
8
use unreal4u\MQTT\Internals\WritableContent;
9
use unreal4u\MQTT\Internals\WritableContentInterface;
10
11
/**
12
 * The PINGREQ Packet is sent from a Client to the Server. It can be used to:
13
 *
14
 * - Indicate to the Server that the Client is alive in the absence of any other Control Packets being sent from the
15
 *   Client to the Server.
16
 * - Request that the Server responds to confirm that it is alive.
17
 * - Exercise the network to indicate that the Network Connection is active.
18
 */
19
final class PingReq extends ProtocolBase implements WritableContentInterface
20
{
21
    use WritableContent;
22
23
    const CONTROL_PACKET_VALUE = 12;
24
25 2
    public function createVariableHeader(): string
26
    {
27 2
        return '';
28
    }
29
30 2
    public function createPayload(): string
31
    {
32 2
        return '';
33
    }
34
35 1
    public function shouldExpectAnswer(): bool
36
    {
37 1
        return true;
38
    }
39
}
40