CanDirective   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A name() 0 3 1
A check() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @author enea dhack <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Enea\Authorization\Blade;
13
14
use Enea\Authorization\Contracts\Authorizable;
15
16
class CanDirective extends CheckableDirective
17
{
18 2
    protected function check(Authorizable $authorizable, string $grantable): bool
19
    {
20 2
        return $authorizable->can($grantable);
21
    }
22
23 101
    public function name(): string
24
    {
25 101
        return 'authenticatedCan';
26
    }
27
}
28