Completed
Push — develop ( 20a922...5bb600 )
by Enea
05:08 queued 03:13
created

Grantable   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

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 27
    public function getSecretName(): string
26
    {
27 27
        return $this->secret_name;
28
    }
29
30 5
    public function getIdentificationKey(): string
31
    {
32 5
        return (string) $this->getKey();
33
    }
34
35 44
    public static function bootGrantable(): void
36
    {
37 44
        static::observe(GrantableObserver::class);
38 44
    }
39
}
40