Conditions | 1 |
Paths | 1 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 1 |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
10 | 10 | protected function resolveAttributeCasting(array $data) |
|
11 | { |
||
12 | 10 | $attributes = (new Collection($this->rules())) |
|
|
|||
13 | ->filter(function ($rule) { |
||
14 | 9 | return $rule instanceof Attribute; |
|
15 | 10 | }); |
|
16 | |||
17 | return $attributes->intersectByKeys($data)->map(function (Attribute $attribute, $key) use ($data) { |
||
18 | 6 | return $this->processCasting($attribute, $data[$key]); |
|
19 | 10 | })->toArray(); |
|
20 | } |
||
62 |