| Conditions | 4 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | 9 | protected function parseAttributesWithKeys($attributes): array |
|
| 21 | { |
||
| 22 | 9 | $result = []; |
|
| 23 | 9 | if (is_array($attributes)) { |
|
| 24 | 3 | foreach ($attributes as $key => $field) { |
|
| 25 | 3 | $value = $this->model->getAttribute($field); |
|
| 26 | 3 | if (is_numeric($key)) { |
|
| 27 | 3 | $result[$field] = $value; |
|
| 28 | } else { |
||
| 29 | 3 | $result[$key] = $value; |
|
| 30 | } |
||
| 31 | } |
||
| 32 | } else { |
||
| 33 | 9 | $result[$attributes] = $this->model->getAttribute($attributes); |
|
| 34 | } |
||
| 35 | |||
| 36 | 9 | return $result; |
|
| 37 | } |
||
| 38 | |||
| 69 |