| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | public function __invoke(GetImage $query): Response |
||
| 30 | { |
||
| 31 | $media = $this->getMedia($query); |
||
| 32 | |||
| 33 | if (!Manipulator::validParams($query->params())) { |
||
| 34 | throw new ImageProcessingFailure('Invalid parameters.'); |
||
| 35 | } |
||
| 36 | |||
| 37 | try { |
||
| 38 | return $this->manipulator->processImage($media, $query->params()); |
||
| 39 | } catch (InvalidFile $e) { |
||
| 40 | throw new ImageProcessingFailure('Manipulation failed.'); |
||
| 41 | } |
||
| 44 |