PingReq::shouldExpectAnswer()   A
last analyzed

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 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 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 /** @noinspection TraitsPropertiesConflictsInspection */
22 1
        WritableContent;
23
24
    private const CONTROL_PACKET_VALUE = 12;
25
26 2
    public function createVariableHeader(): string
27
    {
28 2
        return '';
29
    }
30
31 2
    public function createPayload(): string
32
    {
33 2
        return '';
34
    }
35
36 1
    public function shouldExpectAnswer(): bool
37
    {
38 1
        return true;
39
    }
40
}
41