Passed
Push — develop ( 9557ee...e4ecab )
by Enea
04:24
created

Grantable::getFillable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 2
cts 2
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
crap 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\Models;
10
11
use Illuminate\Database\Eloquent\Model;
12
13
abstract class Grantable extends Model
14
{
15 79
    public function __construct(array $attributes = [])
16
    {
17 79
        $this->setTable($this->getConfigTableName());
18 79
        parent::__construct($attributes);
19 79
    }
20
21
    abstract protected function getConfigTableName(): string;
22
23 79
    public function getFillable()
24
    {
25
        return [
26 79
            'secret_name',
27
            'display_name',
28
            'description'
29
        ];
30
    }
31
32 9
    public function __toString()
33
    {
34 9
        return $this->getAttribute('secret_name');
35
    }
36
}
37