Total Complexity | 6 |
Total Lines | 81 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
6 | abstract class Block extends Payload |
||
7 | { |
||
8 | /** |
||
9 | * Block type. |
||
10 | * |
||
11 | * @var string |
||
12 | */ |
||
13 | protected $type; |
||
14 | |||
15 | /** |
||
16 | * Block identifier. |
||
17 | * |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $block_id; |
||
21 | |||
22 | /** |
||
23 | * Get the block type. |
||
24 | * |
||
25 | * @return string |
||
26 | */ |
||
27 | 14 | public function getType() |
|
30 | } |
||
31 | |||
32 | /** |
||
33 | * Get the block identifier. |
||
34 | * |
||
35 | * @return string |
||
36 | */ |
||
37 | 9 | public function getBlockId() |
|
38 | { |
||
39 | 9 | return $this->block_id; |
|
40 | } |
||
41 | |||
42 | /** |
||
43 | * Set the block identifier. |
||
44 | * |
||
45 | * @param string $blockId |
||
46 | * |
||
47 | * @return Block |
||
48 | */ |
||
49 | 3 | public function setBlockId($blockId) |
|
50 | { |
||
51 | 3 | $this->block_id = $blockId; |
|
52 | |||
53 | 3 | return $this; |
|
54 | } |
||
55 | |||
56 | /** |
||
57 | * Create a Block element from a keyed array of attributes. |
||
58 | * |
||
59 | * @param array $attributes |
||
60 | * |
||
61 | * @return Block |
||
62 | * |
||
63 | * @throws \InvalidArgumentException |
||
64 | */ |
||
65 | 5 | public static function factory(array $attributes) |
|
87 | } |
||
88 | } |
||
89 |