| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 3 |
| CRAP Score | 2.7462 |
| Changes | 0 | ||
| 1 | <?php |
||
| 61 | 1 | public function getPreview(File $file, $maxX, $maxY, $keepAspect) { |
|
| 62 | try { |
||
| 63 | 1 | $preview = $this->previewManager->getPreview($file, $maxX, $maxY, !$keepAspect); |
|
| 64 | 1 | } catch (NotFoundException $e) { |
|
| 65 | return false; |
||
| 66 | } |
||
| 67 | |||
| 68 | $img = new Image($preview->getContent()); |
||
| 69 | return [ |
||
| 70 | 'preview' => $img, |
||
| 71 | 'mimetype' => $img->mimeType() |
||
| 72 | ]; |
||
| 73 | } |
||
| 74 | |||
| 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.