ShiftsSeeder   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 26
rs 10
c 1
b 0
f 0
ccs 0
cts 12
cp 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A run() 0 5 1
A createShift() 0 7 1
1
<?php
2
3
namespace Scool\Timetables\Database\Seeds;
4
5
use Illuminate\Database\Seeder;
6
use Scool\Timetables\Models\Shift;
7
8
/**
9
 * Class ShiftsSeeder
10
 * @package Scool\Timetables\Database\Seeds
11
 */
12
class ShiftsSeeder extends Seeder
13
{
14
    /**
15
     * Run the database seeds.
16
     *
17
     * @return void
18
     */
19
    public function run()
20
    {
21
        $this->createShift('mati', "matinal");
22
        $this->createShift('tarda', "vesprada");
23
    }
24
25
    /**
26
     * @param $name
27
     * @param $code
28
     * @param $lective
29
     */
30
    private function createShift($torn, $name)
31
    {
32
        Shift::firstOrCreate([
33
            'torn' => $torn,
34
            'name' => $name
35
        ]);
36
    }
37
}
38