@@ -30,8 +30,9 @@ discard block |
||
30 | 30 | |
31 | 31 | $location = $request->get('location', '/'); |
32 | 32 | |
33 | - if ( ! $this->manager->exists($location)) |
|
34 | - return static::jsonResponseError(['message' => 'Location not found'], 404); |
|
33 | + if ( ! $this->manager->exists($location)) { |
|
34 | + return static::jsonResponseError(['message' => 'Location not found'], 404); |
|
35 | + } |
|
35 | 36 | |
36 | 37 | return static::jsonResponse( |
37 | 38 | $this->manager->all($location)->values()->toArray() |
@@ -152,11 +153,9 @@ discard block |
||
152 | 153 | |
153 | 154 | if ($type === MediaItem::TYPE_FILE){ |
154 | 155 | $this->manager->deleteFile($path); |
155 | - } |
|
156 | - elseif ($type === MediaItem::TYPE_DIRECTORY) { |
|
156 | + } elseif ($type === MediaItem::TYPE_DIRECTORY) { |
|
157 | 157 | $this->manager->deleteDirectory($path); |
158 | - } |
|
159 | - else { |
|
158 | + } else { |
|
160 | 159 | // TODO: Throw an exception ? |
161 | 160 | } |
162 | 161 |
@@ -160,8 +160,9 @@ |
||
160 | 160 | */ |
161 | 161 | public function exists($path): bool |
162 | 162 | { |
163 | - if ($path === '/') |
|
164 | - return true; |
|
163 | + if ($path === '/') { |
|
164 | + return true; |
|
165 | + } |
|
165 | 166 | |
166 | 167 | return $this->disk()->exists($path); |
167 | 168 | } |