Completed
Push — feature/ajax_skill_dec ( 475068...bfc311 )
by Tristan
07:34
created

SkillStatus   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 6
dl 0
loc 18
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A skill_declarations() 0 2 1
A getStatusAttribute() 0 2 1
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace App\Models\Lookup;
4
5
use App\Models\BaseModel;
6
use Illuminate\Support\Facades\Lang;
7
8
/**
9
 * Class SkillStatus
10
 *
11
 * @property int $id
12
 * @property string $name
13
 * @property \Jenssegers\Date\Date $created_at
14
 * @property \Jenssegers\Date\Date $updated_at
15
 *
16
 * Accessors:
17
 * @property string $status
18
 *
19
 * @property \Illuminate\Database\Eloquent\Collection $skill_declarations
20
 */
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...
21
class SkillStatus extends BaseModel {
0 ignored issues
show
Coding Style introduced by
Opening brace of a class must be on the line after the definition
Loading history...
22
23
    protected $fillable = [
24
        'name'
25
    ];
26
27
    /**
28
     * The accessors to append to the model's array form.
29
     */
30
    protected $appends = ['status'];
31
32
    public function skill_declarations() {
0 ignored issues
show
Coding Style introduced by
Public method name "SkillStatus::skill_declarations" is not in camel caps format
Loading history...
Coding Style introduced by
Missing doc comment for function skill_declarations()
Loading history...
33
        return $this->hasMany(\App\Models\SkillDeclaration::class);
34
    }
35
36
    // Accessors
37
    public function getStatusAttribute() {
0 ignored issues
show
Coding Style introduced by
You must use "/**" style comments for a function comment
Loading history...
38
        return Lang::get('common/skills.status')[$this->name];
39
    }
40
}
41