PermissionChecker   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 18
ccs 0
cts 4
cp 0
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A isPermissionGranted() 0 7 2
1
<?php
2
3
namespace Terranet\Administrator;
4
5
use Terranet\Administrator\Traits\CallableTrait;
6
7
class PermissionChecker implements Contracts\Guard
8
{
9
    use CallableTrait;
10
11
    /**
12
     * Check permissions.
13
     *
14
     * @param $permission
15
     *
16
     * @return bool
17
     */
18
    public function isPermissionGranted($permission)
19
    {
20
        if (\is_callable($permission)) {
21
            return $this->callback($permission);
22
        }
23
24
        return (bool) $permission;
25
    }
26
}
27