Completed
Push — feature/user_input_newlines ( 7c3825...9ce77c )
by Tristan
15:58 queued 09:53
created

Skill   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
wmc 2
eloc 14
dl 0
loc 35
ccs 2
cts 4
cp 0.5
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A skill_declarations() 0 3 1
A skill_type() 0 3 1
1
<?php
2
3
/**
4
 * Created by Reliese Model.
5
 * Date: Thu, 12 Jul 2018 22:39:27 +0000.
6
 */
0 ignored issues
show
Coding Style introduced by
PHP version not specified
Loading history...
Coding Style introduced by
Missing @category tag in file comment
Loading history...
Coding Style introduced by
Missing @package tag in file comment
Loading history...
Coding Style introduced by
Missing @author tag in file comment
Loading history...
Coding Style introduced by
Missing @license tag in file comment
Loading history...
Coding Style introduced by
Missing @link tag in file comment
Loading history...
7
8
namespace App\Models;
9
10
use Illuminate\Support\Facades\Lang;
11
use \Backpack\CRUD\CrudTrait;
12
use Backpack\CRUD\ModelTraits\SpatieTranslatable\HasTranslations;
13
14
/**
15
 * Class Skill
16
 *
17
 * @property int $id
18
 * @property string $name
19
 * @property string $description
20
 * @property int $skill_type_id
21
 *
22
 * @property \App\Models\Lookup\SkillType $skill_type
23
 * @property \Illuminate\Database\Eloquent\Collection $skill_declarations
24
 */
0 ignored issues
show
Coding Style introduced by
Missing @category tag in class comment
Loading history...
Coding Style introduced by
Missing @package tag in class comment
Loading history...
Coding Style introduced by
Missing @author tag in class comment
Loading history...
Coding Style introduced by
Missing @license tag in class comment
Loading history...
Coding Style introduced by
Missing @link tag in class comment
Loading history...
25
class Skill extends BaseModel
26
{
27
    use CrudTrait;
0 ignored issues
show
introduced by
The trait Backpack\CRUD\CrudTrait requires some properties which are not provided by App\Models\Skill: $Type, $fakeColumns
Loading history...
28
    use HasTranslations;
29
30
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
31
     * @var $casts string[]
0 ignored issues
show
Documentation Bug introduced by
The doc comment $casts at position 0 could not be parsed: Unknown type name '$casts' at position 0 in $casts.
Loading history...
32
     * */
33
    protected $casts = [
34
        'skill_type_id' => 'int'
35
    ];
36
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
37
     * @var $fillable string[]
0 ignored issues
show
Documentation Bug introduced by
The doc comment $fillable at position 0 could not be parsed: Unknown type name '$fillable' at position 0 in $fillable.
Loading history...
38
     * */
39
    protected $fillable = [
40
        'name',
41
        'description',
42
        'skill_type_id'
43
    ];
44
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
45
     * @var $translatable string[]
0 ignored issues
show
Documentation Bug introduced by
The doc comment $translatable at position 0 could not be parsed: Unknown type name '$translatable' at position 0 in $translatable.
Loading history...
46
     * */
47
    public $translatable = [
48
        'name',
49
        'description',
50
    ];
51
52 8
    public function skill_type() // phpcs:ignore
53
    {
54 8
        return $this->belongsTo(\App\Models\Lookup\SkillType::class);
55
    }
56
57
    public function skill_declarations() // phpcs:ignore
58
    {
59
        return $this->hasMany(\App\Models\SkillDeclaration::class);
60
    }
61
}
62