Completed
Push — feature/backpack ( 16fb41...46736d )
by Chris
10:31 queued 01:05
created

Skill   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
wmc 2
eloc 15
dl 0
loc 36
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
        'name' => 'string',
35
        'skill_type_id' => 'int'
36
    ];
37
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
38
     * @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...
39
     * */
40
    protected $fillable = [
41
        'name',
42
        'description',
43
        'skill_type_id'
44
    ];
45
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
46
     * @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...
47
     * */
48
    public $translatable = [
49
        'name',
50
        'description',
51
    ];
52
53 8
    public function skill_type() // phpcs:ignore
54
    {
55 8
        return $this->belongsTo(\App\Models\Lookup\SkillType::class);
56
    }
57
58
    public function skill_declarations() // phpcs:ignore
59
    {
60
        return $this->hasMany(\App\Models\SkillDeclaration::class);
61
    }
62
}
63