SirTrevorBlock   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getType() 0 4 1
A getData() 0 4 1
A jsonSerialize() 0 7 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