Passed
Branch master (4ff80c)
by Matt
14:34
created

QuestionsTableSeeder::run()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 8
nc 1
nop 0
dl 0
loc 15
rs 9.4285
c 1
b 0
f 0
1
<?php
2
3
use Illuminate\Database\Seeder;
4
5
class QuestionsTableSeeder 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
    private $table = 'quiz_questions';
8
    /**
9
     * Run the database seeds.
10
     *
11
     * @return void
12
     */
13
    public function run()
14
    {
15
        DB::table($this->table)->truncate();
16
        DB::table($this->table)->insert([
17
        [
18
            'quiz_id' => 1,
19
            'question' => 'Which one of these isn\'t a data structure?'
20
        ],
21
        [
22
            'quiz_id' => 2,
23
            'question' => 'Which one of the following is a set of natural numbers?'
24
        ],
25
        [
26
            'quiz_id' => 3,
27
            'question' => 'Which one of the following is a colour of the rainbow?'
28
        ]
29
        ]);
30
    }
31
}
32