| Conditions | 3 |
| Paths | 3 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | 17 | public function getValue(string $field, $default = null) |
|
| 19 | { |
||
| 20 | 17 | if ($this->isOptionalField($field)) { |
|
| 21 | 9 | $value = ArrayHelper::getValueByPath($this->requestData, $field); |
|
| 22 | 9 | if (empty($value)) { |
|
| 23 | 5 | return $default; |
|
| 24 | } |
||
| 25 | } |
||
| 26 | |||
| 27 | 12 | return ArrayHelper::getValueByPath($this->requestData, $field, $default); |
|
| 28 | } |
||
| 50 |