Passed
Push — feature/permissions-management ( 41e93d )
by
unknown
11:22 queued 04:04
created

RoleRepository   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 5
c 2
b 0
f 0
dl 0
loc 14
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A filter() 0 5 1
1
<?php
2
3
namespace A17\Twill\Repositories;
4
5
use A17\Twill\Models\Role;
6
use A17\Twill\Repositories\Behaviors\HandleRolePermissions;
7
8
class RoleRepository extends ModuleRepository
9
{
10
    use HandleRolePermissions;
0 ignored issues
show
introduced by
The trait A17\Twill\Repositories\B...s\HandleRolePermissions requires some properties which are not provided by A17\Twill\Repositories\RoleRepository: $name, $users, $in_everyone_group
Loading history...
11
12
    public function __construct(Role $model)
13
    {
14
        $this->model = $model;
0 ignored issues
show
Documentation Bug introduced by
It seems like $model of type A17\Twill\Models\Role is incompatible with the declared type A17\Twill\Models\Model of property $model.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
15
    }
16
17
    public function filter($query, array $scopes = [])
18
    {
19
        $this->searchIn($query, $scopes, 'search', ['name']);
20
21
        return parent::filter($query, $scopes);
22
    }
23
}
24