We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
1 | <?php |
||
10 | class Page extends Model implements SluggableInterface |
||
11 | { |
||
12 | use CrudTrait; |
||
13 | use SluggableTrait; |
||
14 | |||
15 | /* |
||
16 | |-------------------------------------------------------------------------- |
||
17 | | GLOBAL VARIABLES |
||
18 | |-------------------------------------------------------------------------- |
||
19 | */ |
||
20 | |||
21 | protected $table = 'pages'; |
||
22 | protected $primaryKey = 'id'; |
||
23 | public $timestamps = true; |
||
24 | // protected $guarded = ['id']; |
||
|
|||
25 | protected $fillable = ['template', 'name', 'title', 'slug', 'content', 'extras']; |
||
26 | // protected $hidden = []; |
||
27 | // protected $dates = []; |
||
28 | protected $fakeColumns = ['extras']; |
||
29 | protected $sluggable = [ |
||
30 | 'build_from' => 'slug_or_title', |
||
31 | 'save_to' => 'slug', |
||
32 | 'on_update' => true, |
||
33 | 'unique' => true, |
||
34 | ]; |
||
35 | |||
36 | /* |
||
37 | |-------------------------------------------------------------------------- |
||
38 | | FUNCTIONS |
||
39 | |-------------------------------------------------------------------------- |
||
40 | */ |
||
41 | |||
42 | public function getTemplateName() |
||
46 | |||
47 | public function getPageLink() |
||
51 | |||
52 | public function getOpenButton() |
||
53 | { |
||
54 | return '<a class="btn btn-default btn-xs" href="'.$this->getPageLink().'" target="_blank"><i class="fa fa-eye"></i> Open</a>'; |
||
55 | } |
||
56 | |||
57 | /* |
||
58 | |-------------------------------------------------------------------------- |
||
59 | | RELATIONS |
||
60 | |-------------------------------------------------------------------------- |
||
61 | */ |
||
62 | |||
63 | /* |
||
64 | |-------------------------------------------------------------------------- |
||
65 | | SCOPES |
||
66 | |-------------------------------------------------------------------------- |
||
67 | */ |
||
68 | |||
69 | /* |
||
70 | |-------------------------------------------------------------------------- |
||
71 | | ACCESORS |
||
72 | |-------------------------------------------------------------------------- |
||
73 | */ |
||
74 | |||
75 | // The slug is created automatically from the "name" field if no slug exists. |
||
76 | public function getSlugOrTitleAttribute() |
||
84 | |||
85 | /* |
||
86 | |-------------------------------------------------------------------------- |
||
87 | | MUTATORS |
||
88 | |-------------------------------------------------------------------------- |
||
89 | */ |
||
90 | } |
||
91 |
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.