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::prefix()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 0
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