Passed
Push — master ( a569b2...1b7ab6 )
by Christian
03:49
created

AttachedRole::attached()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
eloc 2
c 1
b 1
f 0
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Omatech\Mage\Core\Repositories\Roles;
4
5
use Omatech\Mage\Core\Repositories\RoleBaseRepository;
6
use Omatech\Mage\Core\Domains\Roles\Contracts\RoleInterface;
7
use Omatech\Mage\Core\Domains\Roles\Contracts\AttachedRoleInterface;
8
9
class AttachedRole extends RoleBaseRepository implements AttachedRoleInterface
10
{
11 4
    public function attached(RoleInterface $role): bool
12
    {
13 4
        $model = $this->query()->find($role->getId());
14
15 4
        return $model->users->count() > 0;
16
    }
17
}
18