Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Completed
Pull Request — master (#120)
by Pascal
01:39
created

Permission   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 32
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A prefix() 0 10 2
A item() 0 4 1
1
<?php
2
3
namespace Backpack\PermissionManager\app\Models;
4
5
use Backpack\CRUD\CrudTrait;
6
use Spatie\Permission\Models\Permission as OriginalPermission;
7
8
class Permission extends OriginalPermission
9
{
10
    use CrudTrait;
11
12
    protected $fillable = ['name', 'updated_at', 'created_at'];
13
14
    /**
15
     * Gets the permission prefix (eg. admin.page)
16
     *
17
     * @return null
18
     */
19
    public function prefix()
20
    {
21
        if (!str_contains($this->name, '::')) {
22
            return null;
23
        }
24
25
        list($prefix) = explode('::', $this->name);
26
27
        return $prefix;
28
    }
29
30
    /**
31
     * Gets the permission item (eg. list, create, update...)
32
     *
33
     * @return string
34
     */
35
    public function item()
36
    {
37
        return str_after($this->name, '::');
38
    }
39
}
40