EnrollmentPermissionSeeder::run()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 12

Duplication

Lines 14
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 14
loc 14
ccs 0
cts 14
cp 0
rs 9.4285
cc 1
eloc 12
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Scool\EnrollmentMobile\Database\Seeds;
4
5
use Illuminate\Database\Seeder;
6
use Spatie\Permission\Models\Permission;
7
use Spatie\Permission\Models\Role;
8
9
/**
10
 * Class EnrollmentPermissionSeeder
11
 * @package Scool\EnrollmentMobile\Database\Seeds
12
 */
13 View Code Duplication
class EnrollmentPermissionSeeder extends Seeder
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
14
{
15
16
    /**>
17
     * Run the database seeds.
18
     *
19
     * @return void
20
     */
21
    public function run()
22
    {
23
        Permission::create(['name' => 'browse enrollments']);
0 ignored issues
show
Bug introduced by
The method create() does not exist on Spatie\Permission\Models\Permission. Did you maybe mean created()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
24
        Permission::create(['name' => 'read enrollments']);
0 ignored issues
show
Bug introduced by
The method create() does not exist on Spatie\Permission\Models\Permission. Did you maybe mean created()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
25
        Permission::create(['name' => 'edit enrollments']);
0 ignored issues
show
Bug introduced by
The method create() does not exist on Spatie\Permission\Models\Permission. Did you maybe mean created()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
26
        Permission::create(['name' => 'add enrollments']);
0 ignored issues
show
Bug introduced by
The method create() does not exist on Spatie\Permission\Models\Permission. Did you maybe mean created()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
27
        Permission::create(['name' => 'delete enrollments']);
0 ignored issues
show
Bug introduced by
The method create() does not exist on Spatie\Permission\Models\Permission. Did you maybe mean created()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
28
        $role = Role::create(['name' => 'manage enrollments']);
0 ignored issues
show
Bug introduced by
The method create() does not exist on Spatie\Permission\Models\Role. Did you maybe mean created()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
29
        $role->givePermissionTo('browse enrollments');
30
        $role->givePermissionTo('read enrollments');
31
        $role->givePermissionTo('edit enrollments');
32
        $role->givePermissionTo('add enrollments');
33
        $role->givePermissionTo('delete enrollments');
34
    }
35
}
36