Completed
Pull Request — master (#11)
by alexfloppy
06:30
created
app/Console/Commands/MakeJsonApiDemoRemove.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -169,7 +169,7 @@
 block discarded – undo
169 169
 
170 170
             if (file_exists(app_path('JsonApi'))) {
171 171
                 if(!@rmdir(app_path('JsonApi'))) {
172
-                     throw new \League\Flysystem\Exception('JsonApi directory is not empty!');
172
+                        throw new \League\Flysystem\Exception('JsonApi directory is not empty!');
173 173
                 };
174 174
             }
175 175
         } catch (\League\Flysystem\Exception $e) {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     {
131 131
         foreach ($this->migrations as $key => $value) {
132 132
             $mask = database_path('migrations/*' . $value);
133
-            array_map( "unlink", glob( $mask ) );
133
+            array_map("unlink", glob($mask));
134 134
         }
135 135
     }
136 136
 
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
             }
169 169
 
170 170
             if (file_exists(app_path('JsonApi'))) {
171
-                if(!@rmdir(app_path('JsonApi'))) {
171
+                if (!@rmdir(app_path('JsonApi'))) {
172 172
                      throw new \League\Flysystem\Exception('JsonApi directory is not empty!');
173 173
                 };
174 174
             }
Please login to merge, or discard this patch.
app/Console/Commands/MakeJsonApiDemo.php 2 patches
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -4,9 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use Illuminate\Console\Command;
6 6
 use org\bovigo\vfs\vfsStream;
7
-use Symfony\Component\Console\Input\InputInterface;
8
-use Symfony\Component\Console\Output\OutputInterface;
9
-
10 7
 use org\bovigo\vfs\vfsStreamDirectory;
11 8
 use org\bovigo\vfs\vfsStreamWrapper;
12 9
 
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     /**
62 62
      * @var array
63 63
      */
64
-    protected $stubs = [];
64
+    protected $stubs = [ ];
65 65
 
66 66
     /**
67 67
      * Create a new command instance.
@@ -135,22 +135,22 @@  discard block
 block discarded – undo
135 135
     protected function exportControllers()
136 136
     {
137 137
         if ($this->option('fake')) {
138
-            $path = $this->stubs['controllers'];
138
+            $path = $this->stubs[ 'controllers' ];
139 139
             $baseDir = new vfsStreamDirectory('app');
140 140
             vfsStream::copyFromFileSystem($path, $baseDir);
141 141
             return true;
142 142
         }
143 143
 
144 144
         foreach ($this->controllers as $key => $value) {
145
-            if (file_exists(app_path('Http/Controllers/Api/v1/'.$value)) && ! $this->option('force')) {
146
-                if (! $this->confirm("The [{$value}] already exists. Do you want to replace it?")) {
145
+            if (file_exists(app_path('Http/Controllers/Api/v1/' . $value)) && !$this->option('force')) {
146
+                if (!$this->confirm("The [{$value}] already exists. Do you want to replace it?")) {
147 147
                     continue;
148 148
                 }
149 149
             }
150 150
 
151 151
             copy(
152
-                base_path('stubs/Controllers/'.$key),
153
-                app_path('Http/Controllers/Api/v1/'.$value)
152
+                base_path('stubs/Controllers/' . $key),
153
+                app_path('Http/Controllers/Api/v1/' . $value)
154 154
             );
155 155
         }
156 156
     }
@@ -161,22 +161,22 @@  discard block
 block discarded – undo
161 161
     protected function exportModels()
162 162
     {
163 163
         if ($this->option('fake')) {
164
-            $path = $this->stubs['models'];
164
+            $path = $this->stubs[ 'models' ];
165 165
             $baseDir = new vfsStreamDirectory('app');
166 166
             vfsStream::copyFromFileSystem($path, $baseDir);
167 167
             return true;
168 168
         }
169 169
 
170 170
         foreach ($this->models as $key => $value) {
171
-            if (file_exists(app_path('Models/'.$value)) && ! $this->option('force')) {
172
-                if (! $this->confirm("The [{$value}] model already exists. Do you want to replace it?")) {
171
+            if (file_exists(app_path('Models/' . $value)) && !$this->option('force')) {
172
+                if (!$this->confirm("The [{$value}] model already exists. Do you want to replace it?")) {
173 173
                     continue;
174 174
                 }
175 175
             }
176 176
 
177 177
             copy(
178
-                base_path('stubs/Models/'.$key),
179
-                app_path('Models/'.$value)
178
+                base_path('stubs/Models/' . $key),
179
+                app_path('Models/' . $value)
180 180
             );
181 181
         }
182 182
     }
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
     protected function exportMigrations()
188 188
     {
189 189
         if ($this->option('fake')) {
190
-            $path = $this->stubs['migrations'];
190
+            $path = $this->stubs[ 'migrations' ];
191 191
             $baseDir = new vfsStreamDirectory('app');
192 192
             vfsStream::copyFromFileSystem($path, $baseDir);
193 193
             return true;
@@ -195,15 +195,15 @@  discard block
 block discarded – undo
195 195
 
196 196
         $counter = 0;
197 197
         foreach ($this->migrations as $key => $value) {
198
-            if (file_exists(database_path('migrations/'.$value)) && ! $this->option('force')) {
199
-                if (! $this->confirm("The [{$value}] migration already exists. Do you want to replace it?")) {
198
+            if (file_exists(database_path('migrations/' . $value)) && !$this->option('force')) {
199
+                if (!$this->confirm("The [{$value}] migration already exists. Do you want to replace it?")) {
200 200
                     continue;
201 201
                 }
202 202
             }
203 203
 
204 204
             copy(
205 205
                 base_path('stubs/migrations/' . $key),
206
-                database_path('migrations/'. date('Y_m_d_Hi') . '0' . $counter++ . '_' . $value)
206
+                database_path('migrations/' . date('Y_m_d_Hi') . '0' . $counter++ . '_' . $value)
207 207
             );
208 208
         }
209 209
     }
@@ -214,22 +214,22 @@  discard block
 block discarded – undo
214 214
     protected function exportSeeds()
215 215
     {
216 216
         if ($this->option('fake')) {
217
-            $path = $this->stubs['seeds'];
217
+            $path = $this->stubs[ 'seeds' ];
218 218
             $baseDir = new vfsStreamDirectory('app');
219 219
             vfsStream::copyFromFileSystem($path, $baseDir);
220 220
             return true;
221 221
         }
222 222
 
223 223
         foreach ($this->seeds as $key => $value) {
224
-            if (file_exists(database_path('seeds/'.$value)) && ! $this->option('force')) {
225
-                if (! $this->confirm("The [{$value}] already exists. Do you want to replace it?")) {
224
+            if (file_exists(database_path('seeds/' . $value)) && !$this->option('force')) {
225
+                if (!$this->confirm("The [{$value}] already exists. Do you want to replace it?")) {
226 226
                     continue;
227 227
                 }
228 228
             }
229 229
 
230 230
             copy(
231
-                base_path('stubs/seeds/'.$key),
232
-                database_path('seeds/'.$value)
231
+                base_path('stubs/seeds/' . $key),
232
+                database_path('seeds/' . $value)
233 233
             );
234 234
         }
235 235
     }
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
      * @param $src
239 239
      * @param $dst
240 240
      */
241
-    protected function recurse_copy($src,$dst)
241
+    protected function recurse_copy($src, $dst)
242 242
     {
243 243
         $dir = opendir($src);
244 244
         @mkdir($dst);
Please login to merge, or discard this patch.