SchemaJson   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 7
eloc 10
c 2
b 0
f 0
dl 0
loc 38
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getSettingOutput() 0 3 1
A getData() 0 3 1
A setData() 0 4 1
A getSettingCount() 0 3 1
A getSchema() 0 3 1
A isKey() 0 3 1
A getKey() 0 3 1
1
<?php
2
3
namespace  SchemaGenerate\StructureGenerate\Schemes;
4
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
41
    {
42
        return $this->data['settings']['output'];
43
    }
44
}
45