Total Complexity | 7 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | class SchemaJson implements Schema |
||
6 | { |
||
7 | private array $data; |
||
8 | |||
9 | public function setData(array $data): Schema |
||
10 | { |
||
11 | $this->data = $data; |
||
12 | return $this; |
||
13 | } |
||
14 | |||
15 | public function getData(): array |
||
16 | { |
||
17 | return $this->data; |
||
18 | } |
||
19 | |||
20 | public function getSchema(): array |
||
21 | { |
||
22 | return $this->data['schema']; |
||
23 | } |
||
24 | |||
25 | public function getSettingCount($keySchema, int $default = 1): int |
||
26 | { |
||
27 | return $this->data['settings']['counts'][$keySchema] ?? $default; |
||
28 | } |
||
29 | |||
30 | public function isKey($keySchema): bool |
||
31 | { |
||
32 | return isset($this->data['keys'][$keySchema]); |
||
33 | } |
||
34 | |||
35 | public function getKey($keySchema): array |
||
36 | { |
||
37 | return $this->data['keys'][$keySchema]; |
||
38 | } |
||
39 | |||
40 | public function getSettingOutput(): array |
||
43 | } |
||
44 | } |
||
45 |