Passed
Push — master ( 54b800...b2b084 )
by Camilo
02:16
created

EmptyReadableResponse::fillObject()   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 0
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 2
crap 2
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
    use ReadableContent;
21
22
    /**
23
     * @inheritdoc
24 1
     */
25
    public function getOriginControlPacket(): int
26 1
    {
27
        return 0;
28
    }
29
30
    public function fillObject(string $rawMQTTHeaders, ClientInterface $client): ReadableContentInterface
31
    {
32
        return $this;
33
    }
34
}
35