Total Complexity | 8 |
Total Lines | 81 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class AdminResource implements IStringerEntity |
||
10 | { |
||
11 | /** @var string */ |
||
12 | protected $id; |
||
13 | |||
14 | /** @var string */ |
||
15 | protected $identifier; |
||
16 | |||
17 | /** |
||
18 | * Block constructor. |
||
19 | * |
||
20 | * @param string $id |
||
21 | * @param string $identifier |
||
22 | */ |
||
23 | public function __construct(string $id, string $identifier) |
||
24 | { |
||
25 | $this->id = $id; |
||
26 | $this->identifier = $identifier; |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * @return string |
||
31 | */ |
||
32 | public function getId() |
||
33 | { |
||
34 | return $this->id; |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * @param string $id |
||
39 | */ |
||
40 | public function setId($id) |
||
41 | { |
||
42 | $this->id = $id; |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * @return string |
||
47 | */ |
||
48 | public function getIdentifier(): string |
||
49 | { |
||
50 | return $this->identifier; |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * @param string $identifier |
||
55 | * |
||
56 | * @return $this |
||
57 | */ |
||
58 | public function setIdentifier(string $identifier): AdminResource |
||
59 | { |
||
60 | $this->identifier = $identifier; |
||
61 | |||
62 | return $this; |
||
63 | } |
||
64 | |||
65 | /** |
||
66 | * @return string |
||
67 | */ |
||
68 | public function __toString(): string |
||
69 | { |
||
70 | return $this->getIdentifier(); |
||
71 | } |
||
72 | |||
73 | /** |
||
74 | * @return array|null |
||
75 | */ |
||
76 | public function toData(): ?array |
||
81 | ]; |
||
82 | } |
||
83 | |||
84 | /** |
||
85 | * @return string |
||
86 | */ |
||
87 | public function toJSON(): string |
||
90 | } |
||
91 | } |
||
92 |