AwardCat   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 31
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A awardpage() 0 4 1
A subcats() 0 4 1
A user() 0 4 1
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 AwardCat.
14
 *
15
 * @property int $id
16
 * @property string $title
17
 * @property int $award_page_id
18
 * @property int $year
19
 * @property int $month
20
 * @property int $user_id
21
 * @property string $deleted_at
22
 * @property \Carbon\Carbon $created_at
23
 * @property \Carbon\Carbon $updated_at
24
 * @method static \Illuminate\Database\Query\Builder|\App\Models\AwardCat whereId($value)
25
 * @method static \Illuminate\Database\Query\Builder|\App\Models\AwardCat whereTitle($value)
26
 * @method static \Illuminate\Database\Query\Builder|\App\Models\AwardCat whereAwardPageId($value)
27
 * @method static \Illuminate\Database\Query\Builder|\App\Models\AwardCat whereYear($value)
28
 * @method static \Illuminate\Database\Query\Builder|\App\Models\AwardCat whereMonth($value)
29
 * @method static \Illuminate\Database\Query\Builder|\App\Models\AwardCat whereUserId($value)
30
 * @method static \Illuminate\Database\Query\Builder|\App\Models\AwardCat whereDeletedAt($value)
31
 * @method static \Illuminate\Database\Query\Builder|\App\Models\AwardCat whereCreatedAt($value)
32
 * @method static \Illuminate\Database\Query\Builder|\App\Models\AwardCat whereUpdatedAt($value)
33
 * @mixin \Eloquent
34
 * @property-read \App\Models\AwardPage $awardpage
35
 * @property-read \App\Models\User $user
36
 * @property-read \Illuminate\Database\Eloquent\Collection|\Venturecraft\Revisionable\Revision[] $revisionHistory
37
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\AwardSubcat[] $subcats
38
 */
39
class AwardCat extends Model
40
{
41
    use \Venturecraft\Revisionable\RevisionableTrait;
42
43
    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...
44
    protected $table = 'award_cats';
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...
45
    protected $fillable = [
46
        'title',
47
        'award_page_id',
48
        'year',
49
        'month',
50
        'user_id',
51
    ];
52
53
    protected $guarded = [];
54
55
    public function awardpage()
56
    {
57
        return $this->hasOne('App\Models\AwardPage', 'id', 'award_page_id');
58
    }
59
60
    public function subcats()
61
    {
62
        return $this->hasMany('App\Models\AwardSubcat', 'cat_id', 'id');
63
    }
64
65
    public function user()
66
    {
67
        return $this->hasOne('App\Models\User', 'id', 'user_id');
68
    }
69
}
70