Completed
Push — develop ( 45a861...2daf7c )
by Greg
01:55
created
app/Console/Commands/ExportGroups.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -36,25 +36,25 @@
 block discarded – undo
36 36
      *
37 37
      * @return mixed
38 38
      */
39
-     public function handle()
40
-     {
41
-         $groups = Group::get();
39
+        public function handle()
40
+        {
41
+            $groups = Group::get();
42 42
 
43
-         if ($groups->isEmpty()) {
44
-             $this->info("No groups to export");
45
-             return;
46
-         }
43
+            if ($groups->isEmpty()) {
44
+                $this->info("No groups to export");
45
+                return;
46
+            }
47 47
 
48
-         foreach ($groups as $group){
48
+            foreach ($groups as $group){
49 49
             $accounts = $this->fecthAccounts(['group_id' => $group->id]);
50 50
 
51
-             $name = normalise($group->name);
52
-             $filename = "{$this->exportFolder}/{$name}{$this->exportFileExt}";
51
+                $name = normalise($group->name);
52
+                $filename = "{$this->exportFolder}/{$name}{$this->exportFileExt}";
53 53
 
54
-             $count = $this->exportAccounts($accounts, $filename, false, $this->option('ci'));
54
+                $count = $this->exportAccounts($accounts, $filename, false, $this->option('ci'));
55 55
 
56
-             $url = $this->storage->path($filename);
57
-             $this->info("{$count} accounts '{$group->name}' exported into file '{$url}'");
58
-         }
59
-     }
56
+                $url = $this->storage->path($filename);
57
+                $this->info("{$count} accounts '{$group->name}' exported into file '{$url}'");
58
+            }
59
+        }
60 60
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
              return;
46 46
          }
47 47
 
48
-         foreach ($groups as $group){
48
+         foreach ($groups as $group) {
49 49
             $accounts = $this->fecthAccounts(['group_id' => $group->id]);
50 50
 
51 51
              $name = normalise($group->name);
Please login to merge, or discard this patch.
app/Console/Commands/AbstractExportCommand.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         $count = count($accounts);
85 85
 
86 86
         if ($flagCI === false) {
87
-          $bar = $this->output->createProgressBar($count);
87
+            $bar = $this->output->createProgressBar($count);
88 88
         }
89 89
 
90 90
         foreach ($accounts as $account) {
@@ -92,13 +92,13 @@  discard block
 block discarded – undo
92 92
             $record .= $password ? ":{$account->netpass}" : '';
93 93
             $this->storage->prepend($filename, $record);
94 94
             if (isset($bar)) {
95
-              $bar->advance();
95
+                $bar->advance();
96 96
             }
97 97
         }
98 98
 
99 99
         if (isset($bar)) {
100
-          $bar->finish();
101
-          $this->info("\n");
100
+            $bar->finish();
101
+            $this->info("\n");
102 102
         }
103 103
 
104 104
         return $count;
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
         $query = Account::where('status', Account::ACCOUNT_ENABLE);
110 110
 
111 111
         if(is_null($filter) === false && is_array($filter)) {
112
-          $query = $query->where($filter);
112
+            $query = $query->where($filter);
113 113
         }
114 114
 
115 115
         return $query->orderBy('netlogin', 'desc')->get();
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -122,11 +122,11 @@
 block discarded – undo
122 122
      *
123 123
      * @return App\Account
124 124
      */
125
-    final protected function fecthAccounts($filter=null)
125
+    final protected function fecthAccounts($filter = null)
126 126
     {
127 127
         $query = Account::where('status', Account::ACCOUNT_ENABLE);
128 128
 
129
-        if(is_null($filter) === false && is_array($filter)) {
129
+        if (is_null($filter) === false && is_array($filter)) {
130 130
           $query = $query->where($filter);
131 131
         }
132 132
 
Please login to merge, or discard this patch.