ExistsPermission   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
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 14
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A exists() 0 7 1
1
<?php
2
3
namespace Omatech\Mage\Core\Repositories\Permissions;
4
5
use Omatech\Mage\Core\Domains\Permissions\Contracts\ExistsPermissionInterface;
6
use Omatech\Mage\Core\Domains\Permissions\Contracts\PermissionInterface;
7
use Omatech\Mage\Core\Repositories\PermissionBaseRepository;
8
9
class ExistsPermission extends PermissionBaseRepository implements ExistsPermissionInterface
10
{
11
    /**
12
     * @param PermissionInterface $permission
13
     * @return bool
14
     */
15 21
    public function exists(PermissionInterface $permission): bool
16
    {
17 21
        return $this->query()
0 ignored issues
show
Bug introduced by
The method exists() does not exist on Illuminate\Database\Eloquent\Builder. Did you maybe mean canUseExistsForExistenceCheck()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
18 21
            ->where('name', $permission->getName())
19 21
            ->orWhere('id', $permission->getId())
20 21
            ->exists();
21
    }
22
}
23