| 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 | 13 | public function setRequestData(array $requestData): void |
|
| 15 | { |
||
| 16 | 13 | $this->requestData = $requestData; |
|
| 17 | } |
||
| 18 | |||
| 19 | 10 | public function getAttributeValue(string $attribute, $default = null) |
|
| 20 | { |
||
| 21 | 10 | return ArrayHelper::getValueByPath($this->requestData, $attribute, $default, $this->attributeDelimiter); |
|
| 22 | } |
||
| 23 | |||
| 24 | 1 | public function hasAttribute(string $attribute): bool |
|
| 25 | { |
||
| 26 | 1 | 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 |