Code Duplication    Length = 22-22 lines in 3 locations

app/Console/Commands/MakeJsonApiDemo.php 3 locations

@@ 227-248 (lines=22) @@
224
    /**
225
     *
226
     */
227
    protected function exportControllers()
228
    {
229
        if ($this->option('fake')) {
230
            $path = $this->stubs['controllers'];
231
            $baseDir = new vfsStreamDirectory('app');
232
            vfsStream::copyFromFileSystem($path, $baseDir);
233
            return true;
234
        }
235
236
        foreach ($this->controllers as $key => $value) {
237
            if (file_exists(app_path('Http/Controllers/Api/v1/'.$value)) && ! $this->option('force')) {
238
                if (! $this->confirm("The [{$value}] already exists. Do you want to replace it?")) {
239
                    continue;
240
                }
241
            }
242
243
            copy(
244
                base_path('stubs/Controllers/'.$key),
245
                app_path('Http/Controllers/Api/v1/'.$value)
246
            );
247
        }
248
    }
249
250
    /**
251
     *
@@ 253-274 (lines=22) @@
250
    /**
251
     *
252
     */
253
    protected function exportModels()
254
    {
255
        if ($this->option('fake')) {
256
            $path = $this->stubs['models'];
257
            $baseDir = new vfsStreamDirectory('app');
258
            vfsStream::copyFromFileSystem($path, $baseDir);
259
            return true;
260
        }
261
262
        foreach ($this->models as $key => $value) {
263
            if (file_exists(app_path('Models/'.$value)) && ! $this->option('force')) {
264
                if (! $this->confirm("The [{$value}] model already exists. Do you want to replace it?")) {
265
                    continue;
266
                }
267
            }
268
269
            copy(
270
                base_path('stubs/Models/'.$key),
271
                app_path('Models/'.$value)
272
            );
273
        }
274
    }
275
276
    /**
277
     *
@@ 306-327 (lines=22) @@
303
    /**
304
     *
305
     */
306
    protected function exportSeeds()
307
    {
308
        if ($this->option('fake')) {
309
            $path = $this->stubs['seeds'];
310
            $baseDir = new vfsStreamDirectory('app');
311
            vfsStream::copyFromFileSystem($path, $baseDir);
312
            return true;
313
        }
314
315
        foreach ($this->seeds as $key => $value) {
316
            if (file_exists(database_path('seeds/'.$value)) && ! $this->option('force')) {
317
                if (! $this->confirm("The [{$value}] already exists. Do you want to replace it?")) {
318
                    continue;
319
                }
320
            }
321
322
            copy(
323
                base_path('stubs/seeds/'.$key),
324
                database_path('seeds/'.$value)
325
            );
326
        }
327
    }
328
329
    /**
330
     * @param $src