@@ -66,7 +66,9 @@ discard block |
||
| 66 | 66 | { |
| 67 | 67 | static $cache = []; |
| 68 | 68 | |
| 69 | - if (is_numeric($link)) return $link; |
|
| 69 | + if (is_numeric($link)) { |
|
| 70 | + return $link; |
|
| 71 | + } |
|
| 70 | 72 | |
| 71 | 73 | if (!$useCache || !isset($cache[$link])) { |
| 72 | 74 | $cache[$link] = self::where('link', $link)->value('id'); |
@@ -109,10 +111,11 @@ discard block |
||
| 109 | 111 | throw new FileNotFound('Exception - file not found: ' . $file->content->path); |
| 110 | 112 | } |
| 111 | 113 | } catch (\Exception $exception) { |
| 112 | - if ($throwException) |
|
| 113 | - throw $exception; |
|
| 114 | - else |
|
| 115 | - return false; |
|
| 114 | + if ($throwException) { |
|
| 115 | + throw $exception; |
|
| 116 | + } else { |
|
| 117 | + return false; |
|
| 118 | + } |
|
| 116 | 119 | } |
| 117 | 120 | |
| 118 | 121 | return true; |
@@ -196,7 +199,9 @@ discard block |
||
| 196 | 199 | |
| 197 | 200 | public function getThumbnailAttribute() |
| 198 | 201 | { |
| 199 | - if (! $this->thumbnailPossible()) return false; |
|
| 202 | + if (! $this->thumbnailPossible()) { |
|
| 203 | + return false; |
|
| 204 | + } |
|
| 200 | 205 | |
| 201 | 206 | $image = new \Imagick($this->content->path . '[0]'); |
| 202 | 207 | |
@@ -32,8 +32,7 @@ |
||
| 32 | 32 | $mime = $thumbnail['mime']; |
| 33 | 33 | $filename = $thumbnail['name']; |
| 34 | 34 | $contents = $thumbnail['contents']; |
| 35 | - } |
|
| 36 | - else { |
|
| 35 | + } else { |
|
| 37 | 36 | $mime = $file->content->type; |
| 38 | 37 | $filename = $file->name; |
| 39 | 38 | $contents = $file->content->data; |