@@ -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; |
@@ -106,7 +106,9 @@ |
||
| 106 | 106 | $container->js(true, new jsExpression('new ClipboardJS(".copy-button")')); |
| 107 | 107 | |
| 108 | 108 | $container->on('click', '.delete-link', $container->add(['jsCallback', 'postTrigger' => 'link'])->set(function($j, $linkId) { |
| 109 | - if (! $link = FileRemoteAccess::find($linkId)) return; |
|
| 109 | + if (! $link = FileRemoteAccess::find($linkId)) { |
|
| 110 | + return; |
|
| 111 | + } |
|
| 110 | 112 | |
| 111 | 113 | $link->delete(); |
| 112 | 114 | |
@@ -42,7 +42,9 @@ discard block |
||
| 42 | 42 | { |
| 43 | 43 | static $cache = []; |
| 44 | 44 | |
| 45 | - if (is_object($idOrLink)) return $idOrLink; |
|
| 45 | + if (is_object($idOrLink)) { |
|
| 46 | + return $idOrLink; |
|
| 47 | + } |
|
| 46 | 48 | |
| 47 | 49 | $id = self::getIdByLink($idOrLink, true, true); |
| 48 | 50 | |
@@ -73,7 +75,9 @@ discard block |
||
| 73 | 75 | { |
| 74 | 76 | static $cache = []; |
| 75 | 77 | |
| 76 | - if (is_numeric($link)) return $link; |
|
| 78 | + if (is_numeric($link)) { |
|
| 79 | + return $link; |
|
| 80 | + } |
|
| 77 | 81 | |
| 78 | 82 | if (!$useCache || !isset($cache[$link])) { |
| 79 | 83 | $cache[$link] = self::where('link', $link)->value('id'); |
@@ -116,10 +120,11 @@ discard block |
||
| 116 | 120 | throw new FileNotFound('Exception - file not found: ' . $file->content->path); |
| 117 | 121 | } |
| 118 | 122 | } catch (\Exception $exception) { |
| 119 | - if ($throwException) |
|
| 120 | - throw $exception; |
|
| 121 | - else |
|
| 122 | - return false; |
|
| 123 | + if ($throwException) { |
|
| 124 | + throw $exception; |
|
| 125 | + } else { |
|
| 126 | + return false; |
|
| 127 | + } |
|
| 123 | 128 | } |
| 124 | 129 | |
| 125 | 130 | return true; |
@@ -203,7 +208,9 @@ discard block |
||
| 203 | 208 | |
| 204 | 209 | public function getThumbnailAttribute() |
| 205 | 210 | { |
| 206 | - if (! $this->thumbnailPossible()) return false; |
|
| 211 | + if (! $this->thumbnailPossible()) { |
|
| 212 | + return false; |
|
| 213 | + } |
|
| 207 | 214 | |
| 208 | 215 | $image = new \Imagick($this->content->path . '[0]'); |
| 209 | 216 | |
@@ -38,7 +38,9 @@ |
||
| 38 | 38 | }]); |
| 39 | 39 | |
| 40 | 40 | $this->grid->addDecorator('created_by', ['Multiformat', function($row, $column) { |
| 41 | - if (! $user = User::find($row[$column])) return ''; |
|
| 41 | + if (! $user = User::find($row[$column])) { |
|
| 42 | + return ''; |
|
| 43 | + } |
|
| 42 | 44 | |
| 43 | 45 | return [['Template', $user->name]]; |
| 44 | 46 | }]); |