Passed
Push — feature/screening-plan ( d2d4c1...ee7849 )
by Tristan
15:10
created

AssessmentType::getNameAttribute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
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\Assessment;
6
use App\Models\BaseModel;
7
8
/**
9
 * Class AssessmentType
10
 * Database columns:
11
 * @property int $id
0 ignored issues
show
Coding Style introduced by
There must be exactly one blank line before the tags in a doc comment
Loading history...
12
 * @property string $key
13
 * @property \Jenssegers\Date\Date $created_at
14
 * @property \Jenssegers\Date\Date $updated_at
15
 * Relations:
16
 * @property Collection[Assessment] $assessments
17
 * @property Collection[AssessmentTypeTranslation] $assessment_type_translations
18
 * Localized Properties:
19
 * @property string $name
20
 */
0 ignored issues
show
Documentation Bug introduced by
The doc comment Collection[Assessment] at position 1 could not be parsed: Expected ']' at position 1, but found '['.
Loading history...
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 AssessmentType extends BaseModel
22
{
23
    use \Dimsav\Translatable\Translatable;
0 ignored issues
show
introduced by
The trait Dimsav\Translatable\Translatable requires some properties which are not provided by App\Models\Lookup\AssessmentType: $translations, $useTranslationFallback, $translationModel, $localeKey, $translationForeignKey
Loading history...
24
25
    /**
26
     * The columns that can be filled with mass-assignment
27
     *
28
     * @var string[]
29
     */
30
    protected $fillable = [];
31
32
    public $translatedAttributes = ['name'];
33
34
    /**
35
     * Get the collection of Assessments of this type.
36
     *
37
     * @return \Illuminate\Database\Eloquent\Collection
38
     */
39
    public function assessments() // phpcs:ignore
40
    {
41
        return $this->hasMany(Assessment::class);
1 ignored issue
show
Bug Best Practice introduced by
The expression return $this->hasMany(Ap...dels\Assessment::class) returns the type Illuminate\Database\Eloquent\Relations\HasMany which is incompatible with the documented return type Illuminate\Database\Eloquent\Collection.
Loading history...
42
    }
43
44
    public function assessment_type_translations()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function assessment_type_translations()
Loading history...
Coding Style introduced by
Public method name "AssessmentType::assessment_type_translations" is not in camel caps format
Loading history...
45
    {
46
        return $this->hasMany(App\Models\Lookup\AssessmentTypeTranslation::class);
0 ignored issues
show
Bug introduced by
The type App\Models\Lookup\App\Mo...sessmentTypeTranslation was not found. Did you mean App\Models\Lookup\AssessmentTypeTranslation? If so, make sure to prefix the type with \.
Loading history...
47
    }
48
}
49