Passed
Push — master ( 95e7d1...09ce37 )
by Ferry
04:01
created
src/controllers/DeveloperPluginStoreController.php 1 patch
Braces   +7 added lines, -6 removed lines patch added patch discarded remove patch
@@ -93,10 +93,10 @@  discard block
 block discarded – undo
93 93
             if(file_exists(app_path("CBPlugins/".$key))) {
94 94
                 rrmdir(app_path("CBPlugins/".$key));
95 95
                 return response()->json(['status'=>true, 'message'=>'Plugin has been uninstalled!']);
96
-            }else{
96
+            } else{
97 97
                 return response()->json(['status'=>false,'message'=>'Failed to uninstall, plugin is not found']);
98 98
             }
99
-        }else {
99
+        } else {
100 100
             return response()->json(['status'=>false,'message'=>'Failed to uninstall, plugin key is not found']);
101 101
         }
102 102
     }
@@ -108,8 +108,7 @@  discard block
 block discarded – undo
108 108
             if (( $file != '.' ) && ( $file != '..' )) {
109 109
                 if ( is_dir($src . '/' . $file) ) {
110 110
                     $this->recursiveCopy($src . '/' . $file,$dst . '/' . $file);
111
-                }
112
-                else {
111
+                } else {
113 112
                     copy($src . '/' . $file,$dst . '/' . $file);
114 113
                 }
115 114
             }
@@ -140,7 +139,9 @@  discard block
 block discarded – undo
140 139
                     fclose($temp);
141 140
 
142 141
                     // Rename
143
-                    if(file_exists(app_path("CBPlugins/".$key))) rrmdir(app_path("CBPlugins/".$key));
142
+                    if(file_exists(app_path("CBPlugins/".$key))) {
143
+                        rrmdir(app_path("CBPlugins/".$key));
144
+                    }
144 145
                     rename(app_path("CBPlugins/".$dirName), app_path("CBPlugins/".$key));
145 146
 
146 147
                     // Read Plugin JSON
@@ -165,7 +166,7 @@  discard block
 block discarded – undo
165 166
                 } else {
166 167
                     return response()->json(['status'=>false,'message'=>"Failed to install/update, can't open the plugin archive"]);
167 168
                 }
168
-            }else{
169
+            } else{
169 170
                 return response()->json(['status'=>false,'message'=>'Failed to install/update, plugin key is not found']);
170 171
             }
171 172
         } catch (\Exception $e) {
Please login to merge, or discard this patch.