EmptyReadableResponse   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 0
f 0
dl 0
loc 17
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getOriginControlPacket() 0 3 1
A fillObject() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace unreal4u\MQTT\Application;
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
12
/**
13
 * This is an example of a payload class that performs some processing on the data
14
 *
15
 * This particular case will prepend a datetime to the message itself. It will json_encode() it into the payload and
16
 * when retrieving it will set the public property $originalPublishDateTime.
17
 */
18
final class EmptyReadableResponse extends ProtocolBase implements ReadableContentInterface
19
{
20 1
    use ReadableContent;
21
22
    private const CONTROL_PACKET_VALUE = 0;
23
24
    /**
25
     * @inheritdoc
26
     */
27 1
    public function getOriginControlPacket(): int
28
    {
29 1
        return 0;
30
    }
31
32 1
    public function fillObject(string $rawMQTTHeaders, ClientInterface $client): ReadableContentInterface
33
    {
34 1
        return $this;
35
    }
36
}
37