Passed
Pull Request — master (#17)
by ARCANEDEV
03:22
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.
src/Http/Routes/MediaRoutes.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
             $this->prefix('media')->name('media.')->group(function () {
29 29
                 // admin::media.index
30 30
                 $this->get('/', [MediaController::class, 'index'])
31
-                     ->name('index');
31
+                        ->name('index');
32 32
 
33 33
                 $this->mapApiRoutes();
34 34
             });
@@ -43,35 +43,35 @@  discard block
 block discarded – undo
43 43
         $this->prefix('api')->name('api.')->middleware(['ajax'])->group(function () {
44 44
             // admin::media.api.items.index
45 45
             $this->get('items', [MediaApiController::class, 'all'])
46
-                 ->name('items.index');
46
+                    ->name('items.index');
47 47
 
48 48
             // admin::media.api.directories.index
49 49
             $this->get('directories', [MediaApiController::class, 'directories'])
50
-                 ->name('directories.index');
50
+                    ->name('directories.index');
51 51
 
52 52
             // admin::media.api.upload
53 53
             $this->post('upload', [MediaApiController::class, 'upload'])
54
-                 ->name('upload');
54
+                    ->name('upload');
55 55
 
56 56
             // admin::media.api.new-folder
57 57
             $this->post('new-folder', [MediaApiController::class, 'newFolder'])
58
-                 ->name('new-folder');
58
+                    ->name('new-folder');
59 59
 
60 60
             // admin::media.api.move
61 61
             $this->put('move', [MediaApiController::class, 'move'])
62
-                 ->name('move');
62
+                    ->name('move');
63 63
 
64 64
             // admin::media.api.rename
65 65
             $this->put('rename', [MediaApiController::class, 'rename'])
66
-                 ->name('rename');
66
+                    ->name('rename');
67 67
 
68 68
             // admin::media.api.delete
69 69
             $this->delete('delete', [MediaApiController::class, 'delete'])
70
-                 ->name('delete');
70
+                    ->name('delete');
71 71
 
72 72
             // admin::media.api.delete
73 73
             $this->get('download', [MediaApiController::class, 'download'])
74
-                 ->name('download');
74
+                    ->name('download');
75 75
         });
76 76
     }
77 77
 }
Please login to merge, or discard this patch.