| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 61 | public function getPreview(File $file, $maxX, $maxY, $keepAspect) { |
||
| 62 | try { |
||
| 63 | $preview = $this->previewManager->getPreview($file, $maxX, $maxY, !$keepAspect); |
||
| 64 | } catch (NotFoundException $e) { |
||
| 65 | return false; |
||
| 66 | 35 | } |
|
| 67 | |||
| 68 | $img = new Image($preview->getContent()); |
||
| 69 | return [ |
||
| 70 | 'preview' => $img, |
||
| 71 | 35 | 'mimetype' => $img->mimeType() |
|
| 72 | 35 | ]; |
|
| 73 | 35 | } |
|
| 74 | 35 | ||
| 76 |
This check looks for the generic type
arrayas a return type and suggests a more specific type. This type is inferred from the actual code.