Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Completed
Push — master ( cbb5fe...3fd5b1 )
by Cristian
10s
created

Tag::articles()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Backpack\NewsCRUD\app\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Backpack\CRUD\CrudTrait;
7
use Cviebrock\EloquentSluggable\SluggableInterface;
8
use Cviebrock\EloquentSluggable\SluggableTrait;
9
10
class Tag extends Model implements SluggableInterface
11
{
12
    use CrudTrait;
13
    use SluggableTrait;
14
15
    /*
16
    |--------------------------------------------------------------------------
17
    | GLOBAL VARIABLES
18
    |--------------------------------------------------------------------------
19
    */
20
21
    protected $table = 'tags';
22
    protected $primaryKey = 'id';
23
    public $timestamps = true;
24
    // protected $guarded = ['id'];
0 ignored issues
show
Unused Code Comprehensibility introduced by
55% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
25
    protected $fillable = ['name'];
26
    // protected $hidden = [];
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
27
    // protected $dates = [];
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
28
    protected $sluggable = [
29
        'build_from' => 'slug_or_name',
30
        'save_to'    => 'slug',
31
        'on_update'  => true,
32
        'unique'     => true,
33
    ];
34
35
    /*
36
    |--------------------------------------------------------------------------
37
    | FUNCTIONS
38
    |--------------------------------------------------------------------------
39
    */
40
41
    /*
42
    |--------------------------------------------------------------------------
43
    | RELATIONS
44
    |--------------------------------------------------------------------------
45
    */
46
47
    public function articles()
48
    {
49
        return $this->hasMany('Backpack\NewsCRUD\app\Models\Article');
50
    }
51
52
    /*
53
    |--------------------------------------------------------------------------
54
    | SCOPES
55
    |--------------------------------------------------------------------------
56
    */
57
58
    /*
59
    |--------------------------------------------------------------------------
60
    | ACCESORS
61
    |--------------------------------------------------------------------------
62
    */
63
64
    // The slug is created automatically from the "name" field if no slug exists.
65
    public function getSlugOrNameAttribute()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
66
    {
67
        if ($this->slug != '') {
68
            return $this->slug;
69
        }
70
71
        return $this->name;
72
    }
73
74
    /*
75
    |--------------------------------------------------------------------------
76
    | MUTATORS
77
    |--------------------------------------------------------------------------
78
    */
79
}
80