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

Grantable::__toString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
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