Conditions | 3 |
Paths | 2 |
Total Lines | 11 |
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['width']) || false === isset($params['height'])) { |
||
34 | throw new Exception('Params "width" and "height" is required for action "Crop"'); |
||
35 | } |
||
36 | |||
37 | return $image->crop(new Point( |
||
38 | $params['offset_x'] ?? 0, |
||
39 | $params['offset_y'] ?? 0 |
||
40 | ), new Box($params['width'], $params['height'])); |
||
41 | } |
||
42 | } |
||
43 |