Passed
Pull Request — master (#17)
by ARCANEDEV
05:21
created
src/Http/Controllers/MediaApiController.php 1 patch
Braces   +5 added lines, -6 removed lines patch added patch discarded remove patch
@@ -30,8 +30,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/MediaManager.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -160,8 +160,9 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.