AttachedRole   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 13
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A attached() 0 6 1
1
<?php
2
3
namespace Omatech\Mage\Core\Repositories\Roles;
4
5
use Omatech\Mage\Core\Domains\Roles\Contracts\AttachedRoleInterface;
6
use Omatech\Mage\Core\Domains\Roles\Contracts\RoleInterface;
7
use Omatech\Mage\Core\Repositories\RoleBaseRepository;
8
9
class AttachedRole extends RoleBaseRepository implements AttachedRoleInterface
10
{
11
    /**
12
     * @param RoleInterface $role
13
     * @return bool
14
     */
15 4
    public function attached(RoleInterface $role): bool
16
    {
17 4
        $model = $this->query()->find($role->getId());
18
19 4
        return $model->users->count() > 0;
20
    }
21
}
22