Completed
Push — master ( f05ffa...605762 )
by Vasyl
117:24 queued 115:51
created

Slug::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Fomvasss\SlugMaker\Models;
4
5
use Illuminate\Database\Eloquent\Model;
0 ignored issues
show
Bug introduced by
The type Illuminate\Database\Eloquent\Model was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
7
class Slug extends Model
8
{
9
10
    public $timestamps = false;
11
12
    protected $primaryKey = 'name';
13
14
    public $incrementing = false;
15
16
    protected $fillable = [
17
        'name',
18
    ];
19
20
    public function getRouteKeyName()
21
    {
22
        return 'name';
23
    }
24
25
    public function __construct(array $attributes = [])
26
    {
27
28
        parent::__construct($attributes);
29
30
        $this->setTable(config('slugmaker.table_name'));
0 ignored issues
show
Bug introduced by
The function config was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

30
        $this->setTable(/** @scrutinizer ignore-call */ config('slugmaker.table_name'));
Loading history...
31
    }
32
33
    public function slugable()
34
    {
35
        return $this->morphTo();
36
    }
37
}
38