Completed
Push — develop ( 741023...325480 )
by Enea
02:01
created

Grantable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __toString() 0 3 1
1
<?php
2
/**
3
 * Created on 11/02/18 by enea dhack.
4
 */
5
6
namespace Enea\Authorization\Models;
7
8
use Illuminate\Database\Eloquent\Model;
9
10
abstract class Grantable extends Model
11
{
12 30
    public function __construct(array $attributes = [])
13
    {
14 30
        $this->setTable($this->getConfigTableName());
15 30
        parent::__construct($attributes);
16 30
    }
17
18
    abstract protected function getConfigTableName(): string;
19
20 2
    public function __toString()
21
    {
22 2
        return $this->getAttribute('secret_name');
23
    }
24
}
25