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

Grantable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 15
ccs 4
cts 6
cp 0.6667
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
getConfigTableName() 0 1 ?
A __toString() 0 4 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