GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

GuitarsTableSeeder::run()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 451
Code Lines 410

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 1
Metric Value
c 2
b 1
f 1
dl 0
loc 451
rs 8.2857
cc 1
eloc 410
nc 1
nop 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
use Illuminate\Database\Seeder;
4
5
class GuitarsTableSeeder extends Seeder
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
6
{
7
    /**
8
     * Auto generated seed file.
9
     *
10
     * @return void
11
     */
12
    public function run()
13
    {
14
        \DB::table('guitars')->delete();
15
16
        \DB::table('guitars')->insert([
17
            0  => [
18
                    'id'          => 1,
19
                    'purchase_id' => 1,
20
                    'rack_id'     => 1,
21
                    'make_id'     => 2,
22
                    'model_id'    => 5,
23
                    'colour'      => 'Red',
24
                    'damaged'     => 0,
25
                    'condition'   => null,
26
                    'price'       => 1500.0,
27
                    'deleted_at'  => null,
28
                ],
29
            1  => [
30
                    'id'          => 2,
31
                    'purchase_id' => 1,
32
                    'rack_id'     => 1,
33
                    'make_id'     => 2,
34
                    'model_id'    => 4,
35
                    'colour'      => 'Black',
36
                    'damaged'     => 0,
37
                    'condition'   => null,
38
                    'price'       => 1500.0,
39
                    'deleted_at'  => null,
40
                ],
41
            2  => [
42
                    'id'          => 3,
43
                    'purchase_id' => 1,
44
                    'rack_id'     => 3,
45
                    'make_id'     => 2,
46
                    'model_id'    => 3,
47
                    'colour'      => 'Black',
48
                    'damaged'     => 0,
49
                    'condition'   => null,
50
                    'price'       => 2000.0,
51
                    'deleted_at'  => null,
52
                ],
53
            3  => [
54
                    'id'          => 4,
55
                    'purchase_id' => 1,
56
                    'rack_id'     => 1,
57
                    'make_id'     => 2,
58
                    'model_id'    => 2,
59
                    'colour'      => 'Red',
60
                    'damaged'     => 0,
61
                    'condition'   => null,
62
                    'price'       => 1000.0,
63
                    'deleted_at'  => null,
64
                ],
65
            4  => [
66
                    'id'          => 5,
67
                    'purchase_id' => 1,
68
                    'rack_id'     => 2,
69
                    'make_id'     => 2,
70
                    'model_id'    => 5,
71
                    'colour'      => 'Black',
72
                    'damaged'     => 0,
73
                    'condition'   => null,
74
                    'price'       => 1500.0,
75
                    'deleted_at'  => null,
76
                ],
77
            5  => [
78
                    'id'          => 6,
79
                    'purchase_id' => 1,
80
                    'rack_id'     => 3,
81
                    'make_id'     => 2,
82
                    'model_id'    => 1,
83
                    'colour'      => 'Black',
84
                    'damaged'     => 0,
85
                    'condition'   => null,
86
                    'price'       => 1500.0,
87
                    'deleted_at'  => null,
88
                ],
89
            6  => [
90
                    'id'          => 7,
91
                    'purchase_id' => 1,
92
                    'rack_id'     => 1,
93
                    'make_id'     => 2,
94
                    'model_id'    => 3,
95
                    'colour'      => 'Black',
96
                    'damaged'     => 0,
97
                    'condition'   => null,
98
                    'price'       => 1500.0,
99
                    'deleted_at'  => null,
100
                ],
101
            7  => [
102
                    'id'          => 8,
103
                    'purchase_id' => 1,
104
                    'rack_id'     => 3,
105
                    'make_id'     => 2,
106
                    'model_id'    => 1,
107
                    'colour'      => 'Purple',
108
                    'damaged'     => 0,
109
                    'condition'   => null,
110
                    'price'       => 3000.0,
111
                    'deleted_at'  => null,
112
                ],
113
            8  => [
114
                    'id'          => 9,
115
                    'purchase_id' => 1,
116
                    'rack_id'     => 1,
117
                    'make_id'     => 2,
118
                    'model_id'    => 3,
119
                    'colour'      => 'Black',
120
                    'damaged'     => 0,
121
                    'condition'   => null,
122
                    'price'       => 2000.0,
123
                    'deleted_at'  => null,
124
                ],
125
            9  => [
126
                    'id'          => 10,
127
                    'purchase_id' => 1,
128
                    'rack_id'     => 3,
129
                    'make_id'     => 2,
130
                    'model_id'    => 1,
131
                    'colour'      => 'Green',
132
                    'damaged'     => 0,
133
                    'condition'   => null,
134
                    'price'       => 2000.0,
135
                    'deleted_at'  => null,
136
                ],
137
            10 => [
138
                    'id'          => 11,
139
                    'purchase_id' => 3,
140
                    'rack_id'     => 1,
141
                    'make_id'     => 2,
142
                    'model_id'    => 5,
143
                    'colour'      => 'Black',
144
                    'damaged'     => 0,
145
                    'condition'   => null,
146
                    'price'       => 1500.0,
147
                    'deleted_at'  => null,
148
                ],
149
            11 => [
150
                    'id'          => 12,
151
                    'purchase_id' => 3,
152
                    'rack_id'     => 3,
153
                    'make_id'     => 2,
154
                    'model_id'    => 5,
155
                    'colour'      => 'Black',
156
                    'damaged'     => 0,
157
                    'condition'   => null,
158
                    'price'       => 2000.0,
159
                    'deleted_at'  => null,
160
                ],
161
            12 => [
162
                    'id'          => 13,
163
                    'purchase_id' => 3,
164
                    'rack_id'     => 1,
165
                    'make_id'     => 2,
166
                    'model_id'    => 2,
167
                    'colour'      => 'Red',
168
                    'damaged'     => 1,
169
                    'condition'   => 'Broken Strings',
170
                    'price'       => 1500.0,
171
                    'deleted_at'  => null,
172
                ],
173
            13 => [
174
                    'id'          => 14,
175
                    'purchase_id' => 3,
176
                    'rack_id'     => 2,
177
                    'make_id'     => 2,
178
                    'model_id'    => 3,
179
                    'colour'      => 'Red',
180
                    'damaged'     => 0,
181
                    'condition'   => null,
182
                    'price'       => 2000.0,
183
                    'deleted_at'  => null,
184
                ],
185
            14 => [
186
                    'id'          => 15,
187
                    'purchase_id' => 3,
188
                    'rack_id'     => 1,
189
                    'make_id'     => 2,
190
                    'model_id'    => 3,
191
                    'colour'      => 'Black',
192
                    'damaged'     => 0,
193
                    'condition'   => null,
194
                    'price'       => 2000.0,
195
                    'deleted_at'  => null,
196
                ],
197
            15 => [
198
                    'id'          => 16,
199
                    'purchase_id' => 3,
200
                    'rack_id'     => 1,
201
                    'make_id'     => 2,
202
                    'model_id'    => 4,
203
                    'colour'      => 'Black',
204
                    'damaged'     => 0,
205
                    'condition'   => null,
206
                    'price'       => 1200.0,
207
                    'deleted_at'  => null,
208
                ],
209
            16 => [
210
                    'id'          => 17,
211
                    'purchase_id' => 3,
212
                    'rack_id'     => 1,
213
                    'make_id'     => 2,
214
                    'model_id'    => 4,
215
                    'colour'      => 'Black',
216
                    'damaged'     => 0,
217
                    'condition'   => null,
218
                    'price'       => 2000.0,
219
                    'deleted_at'  => null,
220
                ],
221
            17 => [
222
                    'id'          => 18,
223
                    'purchase_id' => 3,
224
                    'rack_id'     => 1,
225
                    'make_id'     => 2,
226
                    'model_id'    => 3,
227
                    'colour'      => 'Black',
228
                    'damaged'     => 0,
229
                    'condition'   => null,
230
                    'price'       => 1200.0,
231
                    'deleted_at'  => null,
232
                ],
233
            18 => [
234
                    'id'          => 19,
235
                    'purchase_id' => 3,
236
                    'rack_id'     => 2,
237
                    'make_id'     => 2,
238
                    'model_id'    => 4,
239
                    'colour'      => 'Black',
240
                    'damaged'     => 0,
241
                    'condition'   => null,
242
                    'price'       => 1200.0,
243
                    'deleted_at'  => null,
244
                ],
245
            19 => [
246
                    'id'          => 20,
247
                    'purchase_id' => 3,
248
                    'rack_id'     => 3,
249
                    'make_id'     => 2,
250
                    'model_id'    => 1,
251
                    'colour'      => 'Black',
252
                    'damaged'     => 0,
253
                    'condition'   => null,
254
                    'price'       => 5000.0,
255
                    'deleted_at'  => null,
256
                ],
257
            20 => [
258
                    'id'          => 21,
259
                    'purchase_id' => 4,
260
                    'rack_id'     => 4,
261
                    'make_id'     => 1,
262
                    'model_id'    => 10,
263
                    'colour'      => 'Black',
264
                    'damaged'     => 0,
265
                    'condition'   => null,
266
                    'price'       => 1000.0,
267
                    'deleted_at'  => null,
268
                ],
269
            21 => [
270
                    'id'          => 22,
271
                    'purchase_id' => 4,
272
                    'rack_id'     => 5,
273
                    'make_id'     => 1,
274
                    'model_id'    => 10,
275
                    'colour'      => 'Red',
276
                    'damaged'     => 0,
277
                    'condition'   => null,
278
                    'price'       => 1000.0,
279
                    'deleted_at'  => null,
280
                ],
281
            22 => [
282
                    'id'          => 23,
283
                    'purchase_id' => 4,
284
                    'rack_id'     => 6,
285
                    'make_id'     => 1,
286
                    'model_id'    => 9,
287
                    'colour'      => 'Black',
288
                    'damaged'     => 0,
289
                    'condition'   => null,
290
                    'price'       => 1200.0,
291
                    'deleted_at'  => null,
292
                ],
293
            23 => [
294
                    'id'          => 24,
295
                    'purchase_id' => 4,
296
                    'rack_id'     => 5,
297
                    'make_id'     => 1,
298
                    'model_id'    => 10,
299
                    'colour'      => 'Black',
300
                    'damaged'     => 0,
301
                    'condition'   => null,
302
                    'price'       => 1200.0,
303
                    'deleted_at'  => null,
304
                ],
305
            24 => [
306
                    'id'          => 25,
307
                    'purchase_id' => 4,
308
                    'rack_id'     => 4,
309
                    'make_id'     => 1,
310
                    'model_id'    => 9,
311
                    'colour'      => 'Red',
312
                    'damaged'     => 0,
313
                    'condition'   => null,
314
                    'price'       => 2000.0,
315
                    'deleted_at'  => null,
316
                ],
317
            25 => [
318
                    'id'          => 26,
319
                    'purchase_id' => 4,
320
                    'rack_id'     => 5,
321
                    'make_id'     => 1,
322
                    'model_id'    => 10,
323
                    'colour'      => 'Black',
324
                    'damaged'     => 0,
325
                    'condition'   => null,
326
                    'price'       => 1000.0,
327
                    'deleted_at'  => null,
328
                ],
329
            26 => [
330
                    'id'          => 27,
331
                    'purchase_id' => 4,
332
                    'rack_id'     => 4,
333
                    'make_id'     => 1,
334
                    'model_id'    => 9,
335
                    'colour'      => 'Black',
336
                    'damaged'     => 0,
337
                    'condition'   => null,
338
                    'price'       => 1200.0,
339
                    'deleted_at'  => null,
340
                ],
341
            27 => [
342
                    'id'          => 28,
343
                    'purchase_id' => 4,
344
                    'rack_id'     => 6,
345
                    'make_id'     => 1,
346
                    'model_id'    => 10,
347
                    'colour'      => 'Black',
348
                    'damaged'     => 0,
349
                    'condition'   => null,
350
                    'price'       => 1200.0,
351
                    'deleted_at'  => null,
352
                ],
353
            28 => [
354
                    'id'          => 29,
355
                    'purchase_id' => 4,
356
                    'rack_id'     => 6,
357
                    'make_id'     => 1,
358
                    'model_id'    => 9,
359
                    'colour'      => 'Black',
360
                    'damaged'     => 0,
361
                    'condition'   => null,
362
                    'price'       => 4000.0,
363
                    'deleted_at'  => null,
364
                ],
365
            29 => [
366
                    'id'          => 30,
367
                    'purchase_id' => 4,
368
                    'rack_id'     => 5,
369
                    'make_id'     => 1,
370
                    'model_id'    => 9,
371
                    'colour'      => 'Black',
372
                    'damaged'     => 0,
373
                    'condition'   => null,
374
                    'price'       => 3000.0,
375
                    'deleted_at'  => null,
376
                ],
377
            30 => [
378
                    'id'          => 31,
379
                    'purchase_id' => 4,
380
                    'rack_id'     => 5,
381
                    'make_id'     => 1,
382
                    'model_id'    => 9,
383
                    'colour'      => 'Red',
384
                    'damaged'     => 0,
385
                    'condition'   => null,
386
                    'price'       => 1000.0,
387
                    'deleted_at'  => null,
388
                ],
389
            31 => [
390
                    'id'          => 32,
391
                    'purchase_id' => 4,
392
                    'rack_id'     => 5,
393
                    'make_id'     => 1,
394
                    'model_id'    => 9,
395
                    'colour'      => 'Black',
396
                    'damaged'     => 0,
397
                    'condition'   => null,
398
                    'price'       => 1000.0,
399
                    'deleted_at'  => null,
400
                ],
401
            32 => [
402
                    'id'          => 33,
403
                    'purchase_id' => 4,
404
                    'rack_id'     => 6,
405
                    'make_id'     => 1,
406
                    'model_id'    => 9,
407
                    'colour'      => 'Black',
408
                    'damaged'     => 0,
409
                    'condition'   => null,
410
                    'price'       => 1000.0,
411
                    'deleted_at'  => null,
412
                ],
413
            33 => [
414
                    'id'          => 34,
415
                    'purchase_id' => 4,
416
                    'rack_id'     => 5,
417
                    'make_id'     => 1,
418
                    'model_id'    => 7,
419
                    'colour'      => 'Black',
420
                    'damaged'     => 0,
421
                    'condition'   => null,
422
                    'price'       => 1000.0,
423
                    'deleted_at'  => null,
424
                ],
425
            34 => [
426
                    'id'          => 35,
427
                    'purchase_id' => 4,
428
                    'rack_id'     => 6,
429
                    'make_id'     => 1,
430
                    'model_id'    => 9,
431
                    'colour'      => 'Black',
432
                    'damaged'     => 0,
433
                    'condition'   => null,
434
                    'price'       => 2000.0,
435
                    'deleted_at'  => null,
436
                ],
437
            35 => [
438
                    'id'          => 36,
439
                    'purchase_id' => 4,
440
                    'rack_id'     => 4,
441
                    'make_id'     => 1,
442
                    'model_id'    => 9,
443
                    'colour'      => 'Black',
444
                    'damaged'     => 0,
445
                    'condition'   => null,
446
                    'price'       => 1000.0,
447
                    'deleted_at'  => null,
448
                ],
449
            36 => [
450
                    'id'          => 37,
451
                    'purchase_id' => 4,
452
                    'rack_id'     => 4,
453
                    'make_id'     => 1,
454
                    'model_id'    => 9,
455
                    'colour'      => 'Black',
456
                    'damaged'     => 1,
457
                    'condition'   => 'Minor Scratches',
458
                    'price'       => 2000.0,
459
                    'deleted_at'  => null,
460
                ],
461
        ]);
462
    }
463
}
464