SirTrevorBlock::getData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
ccs 2
cts 2
cp 1
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Sioen;
4
5
/**
6
 * Class SirTrevorBlock
7
 */
8
final class SirTrevorBlock implements \JsonSerializable
9
{
10
    /** @var string */
11
    private $type;
12
13
    /** @var array */
14
    private $data = array();
15
16
    /**
17
     * @param string $type
18
     * @param array $data
19
     */
20 8
    public function __construct($type, array $data)
21
    {
22 8
        $this->type = $type;
23 8
        $this->data = $data;
24 8
    }
25
26
    /**
27
     * @return string
28
     */
29 5
    public function getType()
30
    {
31 5
        return $this->type;
32
    }
33
34
    /**
35
     * @return array
36
     */
37 5
    public function getData()
38
    {
39 5
        return $this->data;
40
    }
41
42
    /**
43
     * @return array
44
     */
45 3
    public function jsonSerialize()
46
    {
47
        return array(
48 3
            'type' => $this->type,
49 3
            'data' => $this->data,
50 3
        );
51
    }
52
}
53