Conditions | 2 |
Paths | 1 |
Total Lines | 8 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
50 | 1 | public function arrayToProperties(?array $data, mixed $rescue = null): void |
|
51 | { |
||
52 | 1 | collect($data ?? [])->each(function ($value, $key) use ($rescue) { |
|
53 | 1 | if (property_exists($this, $key)) { |
|
54 | 1 | rescue( |
|
55 | 1 | fn () => $this->{$key} = $value, |
|
56 | $rescue, |
||
57 | 1 | config('loop-functions.log') ?? false |
|
58 | ); |
||
63 |