Conditions | 4 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 6 |
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 "Resize"'); |
||
35 | } |
||
36 | |||
37 | return $image->resize( |
||
38 | new Box($params['width'], $params['height']), |
||
39 | isset($params['filter']) ? $params['filter'] : ImageInterface::FILTER_UNDEFINED |
||
40 | ); |
||
41 | } |
||
42 | } |
||
43 |