Total Complexity | 5 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Coverage | 80% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | abstract class RequestModel implements RequestModelInterface |
||
10 | { |
||
11 | private array $requestData = []; |
||
12 | protected string $attributeDelimiter = '.'; |
||
13 | |||
14 | 10 | public function setRequestData(array $requestData): void |
|
15 | { |
||
16 | 10 | $this->requestData = $requestData; |
|
17 | } |
||
18 | |||
19 | 6 | public function getAttributeValue(string $attribute, mixed $default = null): mixed |
|
20 | { |
||
21 | 6 | return ArrayHelper::getValueByPath($this->requestData, $attribute, $default, $this->attributeDelimiter); |
|
22 | } |
||
23 | |||
24 | 3 | public function hasAttribute(string $attribute): bool |
|
25 | { |
||
26 | 3 | return ArrayHelper::pathExists($this->requestData, $attribute, true, $this->attributeDelimiter); |
|
27 | } |
||
28 | |||
29 | 2 | public function getRequestData(): array |
|
32 | } |
||
33 | |||
34 | public function getData(): array |
||
35 | { |
||
39 |