PermissionRelationship   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 5
dl 0
loc 8
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A roles() 0 6 1
1
<?php
2
3
namespace App\Models\Access\Permission\Traits\Relationship;
4
5
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
6
7
/**
8
 * Class PermissionRelationship.
9
 */
10
trait PermissionRelationship
11
{
12
    public function roles(): ?BelongsToMany
13
    {
14
        return $this->belongsToMany(config('access.role'),
0 ignored issues
show
Bug introduced by
It seems like belongsToMany() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

14
        return $this->/** @scrutinizer ignore-call */ belongsToMany(config('access.role'),
Loading history...
15
            config('access.permission_role_table'),
16
            'permission_id',
17
            'role_id');
18
    }
19
}
20