BaseModel::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 7
ccs 4
cts 4
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Helldar\Roles\Models;
4
5
use Helldar\Roles\Facades\Config;
6
use Helldar\Roles\Traits\Searchable;
7
use Helldar\Roles\Traits\SetAttribute;
8
use Illuminate\Database\Eloquent\Model;
9
10
/**
11
 * @property int $id
12
 * @property string $slug
13
 * @property string $title
14
 *
15
 * @method static Model|self create(array $values)
16
 */
17
abstract class BaseModel extends Model
18
{
19
    use SetAttribute;
20
    use Searchable;
21
22
    public $timestamps = false;
23
24
    protected $fillable = ['slug', 'title'];
25
26 138
    public function __construct(array $attributes = [])
27
    {
28 138
        $this->setConnection(
29 138
            Config::connection()
30
        );
31
32 138
        parent::__construct($attributes);
33 138
    }
34
}
35