| Conditions | 4 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public static function handle(ManipulatorInterface $image, array $params = []): ManipulatorInterface |
||
| 32 | { |
||
| 33 | if (false === isset($params['image'])) { |
||
| 34 | throw new Exception('Param "image" is required for action "Watermark"'); |
||
| 35 | } |
||
| 36 | |||
| 37 | $watermark = EasyImage::getImagine()->open($params['image'])->copy(); |
||
| 38 | |||
| 39 | return $image->paste($watermark, new Point( |
||
| 40 | isset($params['offset_x']) ? $params['offset_x'] : 0, |
||
| 41 | isset($params['offset_y']) ? $params['offset_y'] : 0 |
||
| 42 | )); |
||
| 43 | } |
||
| 44 | } |
||
| 45 |