Passed
Pull Request — master (#11)
by Pavel
06:35
created

SampleEntity   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 33.33%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 46
ccs 4
cts 12
cp 0.3333
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getId() 0 4 1
A getPayload() 0 4 1
A jsonSerialize() 0 7 1
1
<?php
2
3
namespace Bankiru\Api\JsonRpc\Test\Entity;
4
5
class SampleEntity implements \JsonSerializable
6
{
7
    /** @var int|null */
8
    private $id;
9
    /** @var  string */
10
    private $payload;
11
12
    /** @var  string */
13
    private $secret;
14
15
    /**
16
     * SampleEntity constructor.
17
     *
18
     * @param string $payload
19
     */
20 4
    public function __construct($payload)
21
    {
22 4
        $this->payload = $payload;
23 4
        $this->secret  = 'secret-payload';
24 4
    }
25
26
    /**
27
     * @return int|null
28
     */
29
    public function getId()
30
    {
31
        return $this->id;
32
    }
33
34
    /**
35
     * @return string
36
     */
37
    public function getPayload()
38
    {
39
        return $this->payload;
40
    }
41
42
    /** {@inheritdoc} */
43
    public function jsonSerialize()
44
    {
45
        return [
46
            'id'             => $this->id,
47
            'sample_payload' => $this->payload,
48
        ];
49
    }
50
}
51