AwardSubcat::award_cat()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 4
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * rmarchiv.tk
5
 * (c) 2016-2017 by Marcel 'ryg' Hering
6
 */
7
8
namespace App\Models;
9
10
use Illuminate\Database\Eloquent\Model;
11
12
/**
13
 * Class AwardSubcat.
14
 *
15
 * @property int $id
16
 * @property string $title
17
 * @property string $desc_html
18
 * @property string $desc_md
19
 * @property \Carbon\Carbon $created_at
20
 * @property \Carbon\Carbon $updated_at
21
 * @property int $page_id
22
 * @property int $cat_id
23
 * @method static \Illuminate\Database\Query\Builder|\App\Models\AwardSubcat whereId($value)
24
 * @method static \Illuminate\Database\Query\Builder|\App\Models\AwardSubcat whereTitle($value)
25
 * @method static \Illuminate\Database\Query\Builder|\App\Models\AwardSubcat whereDescHtml($value)
26
 * @method static \Illuminate\Database\Query\Builder|\App\Models\AwardSubcat whereDescMd($value)
27
 * @method static \Illuminate\Database\Query\Builder|\App\Models\AwardSubcat whereCreatedAt($value)
28
 * @method static \Illuminate\Database\Query\Builder|\App\Models\AwardSubcat whereUpdatedAt($value)
29
 * @method static \Illuminate\Database\Query\Builder|\App\Models\AwardSubcat wherePageId($value)
30
 * @method static \Illuminate\Database\Query\Builder|\App\Models\AwardSubcat whereCatId($value)
31
 * @mixin \Eloquent
32
 * @property-read \Illuminate\Database\Eloquent\Collection|\Venturecraft\Revisionable\Revision[] $revisionHistory
33
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\GamesAward[] $game_awards
34
 * @property-read \App\Models\AwardCat $award_cat
35
 */
36 View Code Duplication
class AwardSubcat extends Model
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
37
{
38
    use \Venturecraft\Revisionable\RevisionableTrait;
39
    public $timestamps = true;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
40
    protected $table = 'award_subcats';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
41
    protected $fillable = [
42
        'title',
43
        'desc_html',
44
        'desc_md',
45
        'page_id',
46
        'cat_id',
47
    ];
48
49
    protected $guarded = [];
50
51
    public function game_awards()
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...
52
    {
53
        return $this->hasMany('App\Models\GamesAward', 'award_subcat_id', 'id')->orderBy('place');
54
    }
55
56
    public function award_cat()
57
    {
58
        return $this->hasOne('App\Models\AwardCat', 'id', 'cat_id');
59
    }
60
}
61