Passed
Pull Request — dev (#832)
by Tristan
19:00 queued 13:53
created

Applicant::references()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
/**
4
 * Created by Reliese Model.
5
 * Date: Thu, 12 Jul 2018 22:39:27 +0000.
6
 */
7
8
namespace App\Models;
9
10
use App\Models\WorkSample;
11
use Illuminate\Database\Eloquent\Collection;
12
13
/**
14
 * Class Applicant
15
 *
16
 * @property int $id
17
 * @property string $personal_website
18
 * @property string $tagline
19
 * @property string $twitter_username
20
 * @property string $linkedin_url
21
 * @property int $user_id
22
 * @property boolean $is_snapshot
23
 *
24
 * @property \Jenssegers\Date\Date $created_at
25
 * @property \Jenssegers\Date\Date $updated_at
26
 *
27
 * @property \App\Models\User $user
28
 * @property \Illuminate\Database\Eloquent\Collection $applicant_profile_answers
29
 * @property \Illuminate\Database\Eloquent\Collection $job_applications
30
 * @property \Illuminate\Database\Eloquent\Collection $degrees
31
 * @property \Illuminate\Database\Eloquent\Collection $courses
32
 * @property \Illuminate\Database\Eloquent\Collection $work_experiences
33
 * @property \Illuminate\Database\Eloquent\Collection $skill_declarations
34
 * @property \Illuminate\Database\Eloquent\Collection $references
35
 * @property \Illuminate\Database\Eloquent\Collection $work_samples
36
 * @property \Illuminate\Database\Eloquent\Collection $projects
37
 */
38
class Applicant extends BaseModel
39
{
40
41
    protected $casts = [
1 ignored issue
show
introduced by
Property \App\Models\Applicant::$casts does not have @var annotation.
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
42
        'user_id' => 'int',
43
        'personal_website' => 'string',
44
        'tagline' => 'string',
45
        'twitter_username' => 'string',
46
        'linkedin_url' => 'string',
47
        'is_snapshot' => 'boolean'
48
    ];
49
    protected $fillable = [
1 ignored issue
show
introduced by
Property \App\Models\Applicant::$fillable does not have @var annotation.
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
50
        'personal_website',
51
        'tagline',
52
        'twitter_username',
53
        'linkedin_url'
54
    ];
55
56 25
    public function user()
1 ignored issue
show
introduced by
Method \App\Models\Applicant::user() does not have return type hint nor @return annotation for its return value.
Loading history...
Coding Style Documentation introduced by
Missing doc comment for function user()
Loading history...
57
    {
58 25
        return $this->belongsTo(\App\Models\User::class);
59
    }
60
61
    public function applicant_profile_answers()
1 ignored issue
show
Coding Style introduced by
Method name "Applicant::applicant_profile_answers" is not in camel caps format
Loading history...
introduced by
Method \App\Models\Applicant::applicant_profile_answers() does not have return type hint nor @return annotation for its return value.
Loading history...
Coding Style Documentation introduced by
Missing doc comment for function applicant_profile_answers()
Loading history...
62
    {
63
        return $this->hasMany(\App\Models\ApplicantProfileAnswer::class);
64
    }
65
66
    public function job_applications()
1 ignored issue
show
Coding Style introduced by
Method name "Applicant::job_applications" is not in camel caps format
Loading history...
introduced by
Method \App\Models\Applicant::job_applications() does not have return type hint nor @return annotation for its return value.
Loading history...
Coding Style Documentation introduced by
Missing doc comment for function job_applications()
Loading history...
67
    {
68
        if ($this->is_snapshot) {
69
            return $this->hasMany(\App\Models\JobApplication::class, 'applicant_snapshot_id');
70
        }
71
        return $this->hasMany(\App\Models\JobApplication::class);
72
    }
73
74
    public function degrees()
1 ignored issue
show
introduced by
Method \App\Models\Applicant::degrees() does not have return type hint nor @return annotation for its return value.
Loading history...
Coding Style Documentation introduced by
Missing doc comment for function degrees()
Loading history...
75
    {
76
        return $this->hasMany(\App\Models\Degree::class)->orderBy('end_date', 'desc');
77
    }
78
79
    public function courses()
1 ignored issue
show
introduced by
Method \App\Models\Applicant::courses() does not have return type hint nor @return annotation for its return value.
Loading history...
Coding Style Documentation introduced by
Missing doc comment for function courses()
Loading history...
80
    {
81
        return $this->hasMany(\App\Models\Course::class)->orderBy('end_date', 'desc');
82
    }
83
84
    public function work_experiences()
1 ignored issue
show
Coding Style introduced by
Method name "Applicant::work_experiences" is not in camel caps format
Loading history...
introduced by
Method \App\Models\Applicant::work_experiences() does not have return type hint nor @return annotation for its return value.
Loading history...
Coding Style Documentation introduced by
Missing doc comment for function work_experiences()
Loading history...
85
    {
86
        return $this->hasMany(\App\Models\WorkExperience::class)->orderBy('end_date', 'desc');
87
    }
88
89 2
    public function skill_declarations()
1 ignored issue
show
Coding Style introduced by
Method name "Applicant::skill_declarations" is not in camel caps format
Loading history...
introduced by
Method \App\Models\Applicant::skill_declarations() does not have return type hint nor @return annotation for its return value.
Loading history...
Coding Style Documentation introduced by
Missing doc comment for function skill_declarations()
Loading history...
90
    {
91 2
        return $this->hasMany(\App\Models\SkillDeclaration::class);
92
    }
93
94 1
    public function references()
1 ignored issue
show
introduced by
Method \App\Models\Applicant::references() does not have return type hint nor @return annotation for its return value.
Loading history...
Coding Style Documentation introduced by
Missing doc comment for function references()
Loading history...
95
    {
96 1
        return $this->hasMany(\App\Models\Reference::class);
97
    }
98
99
    public function work_samples()
1 ignored issue
show
Coding Style introduced by
Method name "Applicant::work_samples" is not in camel caps format
Loading history...
introduced by
Method \App\Models\Applicant::work_samples() does not have return type hint nor @return annotation for its return value.
Loading history...
Coding Style Documentation introduced by
Missing doc comment for function work_samples()
Loading history...
100
    {
101
        return $this->hasMany(\App\Models\WorkSample::class);
102
    }
103
104
    public function projects()
1 ignored issue
show
introduced by
Method \App\Models\Applicant::projects() does not have return type hint nor @return annotation for its return value.
Loading history...
Coding Style Documentation introduced by
Missing doc comment for function projects()
Loading history...
105
    {
106
        return $this->hasMany(\App\Models\Project::class);
107
    }
108
}
109