| Conditions | 2 |
| Paths | 1 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 46 | public static function deserialize(array $data): AbstractImagesEvent |
||
| 47 | { |
||
| 48 | $images = ImageCollection::fromArray( |
||
| 49 | array_map( |
||
| 50 | function ($imageData) { |
||
| 51 | return Image::deserialize($imageData); |
||
| 52 | }, |
||
| 53 | $data['images'] |
||
| 54 | ) |
||
| 55 | ); |
||
| 56 | |||
| 57 | return new static( |
||
| 58 | $data['item_id'], |
||
| 59 | isset($data['main_image']) |
||
| 60 | ? $images->withMain(Image::deserialize($data['main_image'])) |
||
| 61 | : $images |
||
| 62 | ); |
||
| 63 | } |
||
| 64 | } |
||
| 65 |