Passed
Push — develop ( 97f65e...d0561f )
by Enea
03:00
created

Grantable   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 17
ccs 0
cts 11
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getSecretName() 0 3 1
A bootGrantable() 0 3 1
A getIdentificationKey() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * Created on 11/02/18 by enea dhack.
7
 */
8
9
namespace Enea\Authorization\Traits;
10
11
use Enea\Authorization\Observers\GrantableObserver;
12
13
/**
14
 * Trait Grantable.
15
 *
16
 * @package Enea\Authorization\Traits
17
 *
18
 * @property int id
19
 * @property string secret_name
20
 */
21
trait Grantable
22
{
23
    use Model;
24
25
    public function getSecretName(): string
26
    {
27
        return $this->secret_name;
28
    }
29
30
    public function getIdentificationKey(): string
31
    {
32
        return (string) $this->getKey();
33
    }
34
35
    public static function bootGrantable(): void
36
    {
37
        static::observe(GrantableObserver::class);
38
    }
39
}
40