| Total Complexity | 2 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 6 | class Polygon implements CastsAttributes |
||
| 7 | { |
||
| 8 | |||
| 9 | /** |
||
| 10 | * Transform the attribute from the underlying model values. |
||
| 11 | * |
||
| 12 | * @param \Illuminate\Database\Eloquent\Model $model |
||
| 13 | * @param string $key |
||
| 14 | * @param mixed $value |
||
| 15 | * @param array<string, mixed> $attributes |
||
| 16 | * @return mixed |
||
| 17 | */ |
||
| 18 | public function get($model, $key, $value, $attributes) |
||
| 19 | { |
||
| 20 | return json_decode($value, true); |
||
| 21 | } |
||
| 22 | |||
| 23 | |||
| 24 | /** |
||
| 25 | * Transform the attribute to its underlying model values. |
||
| 26 | * |
||
| 27 | * @param \Illuminate\Database\Eloquent\Model $model |
||
| 28 | * @param string $key |
||
| 29 | * @param mixed $value |
||
| 30 | * @param array<string, mixed> $attributes |
||
| 31 | * @return mixed |
||
| 32 | */ |
||
| 33 | public function set($model, $key, $value, $attributes) |
||
| 36 | } |
||
| 37 | } |