Code Duplication    Length = 15-15 lines in 4 locations

app/Console/Commands/MakeJsonApiDemo.php 4 locations

@@ 177-191 (lines=15) @@
174
    /**
175
     *
176
     */
177
    protected function copyJsonApiEntities()
178
    {
179
        foreach ($this->jsonapiEntities as $key => $value) {
180
            if (file_exists(app_path('JsonApi/'.$value)) && ! $this->option('force')) {
181
                if (! $this->confirm("The [{$value}] already exists. Do you want to replace it?")) {
182
                    continue;
183
                }
184
            }
185
186
            copy(
187
                base_path('stubs/'.$key),
188
                app_path($value)
189
            );
190
        }
191
    }
192
193
    /**
194
     *
@@ 196-210 (lines=15) @@
193
    /**
194
     *
195
     */
196
    protected function exportControllers()
197
    {
198
        foreach ($this->controllers as $key => $value) {
199
            if (file_exists(app_path('Http/Controllers/Api/v1/'.$value)) && ! $this->option('force')) {
200
                if (! $this->confirm("The [{$value}] already exists. Do you want to replace it?")) {
201
                    continue;
202
                }
203
            }
204
205
            copy(
206
                base_path('stubs/Controllers/'.$key),
207
                app_path('Http/Controllers/Api/v1/'.$value)
208
            );
209
        }
210
    }
211
212
    /**
213
     *
@@ 215-229 (lines=15) @@
212
    /**
213
     *
214
     */
215
    protected function exportModels()
216
    {
217
        foreach ($this->models as $key => $value) {
218
            if (file_exists(app_path('Models/'.$value)) && ! $this->option('force')) {
219
                if (! $this->confirm("The [{$value}] model already exists. Do you want to replace it?")) {
220
                    continue;
221
                }
222
            }
223
224
            copy(
225
                base_path('stubs/Models/'.$key),
226
                app_path('Models/'.$value)
227
            );
228
        }
229
    }
230
231
    /**
232
     *
@@ 254-268 (lines=15) @@
251
    /**
252
     *
253
     */
254
    protected function exportSeeds()
255
    {
256
        foreach ($this->seeds as $key => $value) {
257
            if (file_exists(database_path('seeds/'.$value)) && ! $this->option('force')) {
258
                if (! $this->confirm("The [{$value}] already exists. Do you want to replace it?")) {
259
                    continue;
260
                }
261
            }
262
263
            copy(
264
                base_path('stubs/seeds/'.$key),
265
                database_path('seeds/'.$value)
266
            );
267
        }
268
    }
269
270
    /**
271
     * @param $src