Passed
Push — master ( 638d34...c14ede )
by Ferry
04:41
created
src/controllers/DeveloperPluginStoreController.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -28,21 +28,21 @@  discard block
 block discarded – undo
28 28
     public function getIndex() {
29 29
         $data = [];
30 30
         $data['result'] = $this->fetchPluginData();
31
-        return view($this->view.'.index',$data);
31
+        return view($this->view.'.index', $data);
32 32
     }
33 33
 
34 34
     public function getUninstall($key)
35 35
     {
36 36
         $pluginData = $this->fetchPluginData();
37 37
 
38
-        if(isset($pluginData[$key])) {
39
-            if(file_exists(app_path("CBPlugins/".$key))) {
38
+        if (isset($pluginData[$key])) {
39
+            if (file_exists(app_path("CBPlugins/".$key))) {
40 40
                 rrmdir(app_path("CBPlugins/".$key));
41
-                return cb()->redirectBack('Plugin has been uninstalled!','success');
42
-            }else{
41
+                return cb()->redirectBack('Plugin has been uninstalled!', 'success');
42
+            } else {
43 43
                 return cb()->redirectBack('Failed to uninstall, plugin is not found');
44 44
             }
45
-        }else {
45
+        } else {
46 46
             return cb()->redirectBack('Failed to uninstall, plugin key is not found');
47 47
         }
48 48
     }
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     {
52 52
         $pluginData = $this->fetchPluginData();
53 53
 
54
-        if(isset($pluginData[$key])) {
54
+        if (isset($pluginData[$key])) {
55 55
             $plugin = $pluginData[$key];
56 56
 
57 57
             // Create temp file of zip plugin
@@ -71,19 +71,19 @@  discard block
 block discarded – undo
71 71
                 // Rename
72 72
                 rename(app_path("CBPlugins/".$dirName), app_path("CBPlugins/".$key));
73 73
 
74
-                return cb()->redirectBack('Install / update plugin has been succesfull!','success');
74
+                return cb()->redirectBack('Install / update plugin has been succesfull!', 'success');
75 75
 
76 76
             } else {
77 77
                 return cb()->redirectBack("Failed to install/update, can't open the plugin archive");
78 78
             }
79
-        }else{
79
+        } else {
80 80
             return cb()->redirectBack('Failed to install/update, plugin key is not found');
81 81
         }
82 82
     }
83 83
 
84 84
     private function fetchPluginData()
85 85
     {
86
-        if($data = Cache::get("plugin_store_data")) {
86
+        if ($data = Cache::get("plugin_store_data")) {
87 87
             return $data;
88 88
         }
89 89
 
@@ -92,13 +92,13 @@  discard block
 block discarded – undo
92 92
         try {
93 93
             $data = file_get_contents(base64_decode("aHR0cDovL2NydWRib29zdGVyLmNvbS9hcGkvcGx1Z2luP2FjY2Vzc190b2tlbj1iVmMvWm5wWU5TWnJNVlpZT0hFNVUydHFjU1U9"));
94 94
 
95
-            if($data) {
95
+            if ($data) {
96 96
                 $data = json_decode($data, true);
97
-                if($data['status']==true) {
97
+                if ($data['status'] == true) {
98 98
 
99
-                    foreach($data['data'] as $item) {
99
+                    foreach ($data['data'] as $item) {
100 100
                         $key = $item['key'];
101
-                        $result[ $key ] = $item;
101
+                        $result[$key] = $item;
102 102
                     }
103 103
 
104 104
                     $result = collect($result)->sortBy("name")->all();
Please login to merge, or discard this patch.