Completed
Push — master ( 1b3824...49fa37 )
by Camilo
02:40
created

PubComp::shouldExpectAnswer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace unreal4u\MQTT\Protocol;
6
7
use unreal4u\MQTT\Internals\ClientInterface;
8
use unreal4u\MQTT\Internals\ProtocolBase;
9
use unreal4u\MQTT\Internals\ReadableContent;
10
use unreal4u\MQTT\Internals\ReadableContentInterface;
11
use unreal4u\MQTT\Internals\WritableContent;
12
use unreal4u\MQTT\Internals\WritableContentInterface;
13
14
final class PubComp extends ProtocolBase implements ReadableContentInterface, WritableContentInterface
15
{
16
    use ReadableContent;
17
    use WritableContent;
18
19
    public $packetIdentifier = 0;
20
21
    const CONTROL_PACKET_VALUE = 7;
22
23
    public function fillObject(string $rawMQTTHeaders, ClientInterface $client): ReadableContentInterface
24
    {
25
        $this->packetIdentifier = $this->extractPacketIdentifier($rawMQTTHeaders);
26
        return $this;
27
    }
28
29
    /**
30
     * Creates the variable header that each method has
31
     * @return string
32
     */
33
    public function createVariableHeader(): string
34
    {
35
        // TODO: Implement createVariableHeader() method.
36
        return '';
37
    }
38
39
    /**
40
     * Creates the actual payload to be sent
41
     * @return string
42
     */
43
    public function createPayload(): string
44
    {
45
        // TODO: Implement createPayload() method.
46
        return '';
47
    }
48
49
    /**
50
     * @inheritdoc
51
     */
52
    public function expectAnswer(string $data, ClientInterface $client): ReadableContentInterface
53
    {
54
        return $this;
55
    }
56
57
    /**
58
     * Some responses won't expect an answer back, others do in some situations
59
     * @return bool
60
     */
61
    public function shouldExpectAnswer(): bool
62
    {
63
        return false;
64
    }
65
}
66