Completed
Push — develop ( 0bdcf1...3b506c )
by Enea
09:31 queued 08:05
created

Grantable::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 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 52
    public function __construct(array $attributes = [])
13
    {
14 52
        $this->setTable($this->getConfigTableName());
15 52
        parent::__construct($attributes);
16 52
    }
17
18
    abstract protected function getConfigTableName(): string;
19
20
    public function __toString()
21
    {
22
        return $this->getAttribute('secret_name');
23
    }
24
}
25