| Conditions | 3 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 52 | return new self($setter); |
||
| 53 | } |
||
| 54 | |||
| 55 | /** @inheritdoc */ |
||
| 56 | public function writeTo(object $target, array $data): void |
||
| 57 | { |
||
| 58 | foreach ($data as $attribute => $value) { |
||
| 59 | try { |
||
| 60 | $this->setter->call($target, $attribute, $value); |
||
| 61 | } catch (Throwable $exception) { |
||
| 62 | throw HydrationFailed::encountered($exception, $target); |
||
| 63 | } |
||
| 64 | } |
||
| 65 | } |
||
| 66 | } |
||
| 67 |