Passed
Push — dependabot/npm_and_yarn/dev/st... ( 917c39...79f3f4 )
by
unknown
12:32 queued 07:14
created

Comment   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 5
c 1
b 0
f 0
dl 0
loc 22
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A user() 0 3 1
A job_poster() 0 3 1
A comment_type() 0 3 1
1
<?php
2
3
namespace App\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
/**
8
 * Class Comment
9
 *
10
 * @property int $id
11
 * @property int $job_poster_id
12
 * @property int $user_id
13
 * @property string $comment
14
 * @property string $location
15
 * @property \App\Models\Lookup\CommentType $type_id
16
 * @property \Jenssegers\Date\Date $created_at
17
 * @property \Jenssegers\Date\Date $updated_at
18
 *
19
 * @property \App\Models\JobPoster $job_poster
20
 * @property \App\Models\User $user
21
 * @property \App\Models\Lookup\CommentType $comment_type
22
 */
23
24
class Comment extends Model
25
{
26
    /**
27
     * The attributes that are mass assignable.
28
     *
29
     * @var array
30
     */
31
    protected $fillable = ['comment', 'location', 'type_id'];
32
33
    public function job_poster() // phpcs:ignore
34
    {
35
        return $this->belongsTo(\App\Models\JobPoster::class);
36
    }
37
38
    public function user() // phpcs:ignore
39
    {
40
        return $this->belongsTo(\App\Models\User::class);
41
    }
42
43
    public function comment_type() // phpcs:ignore
44
    {
45
        return $this->belongsTo(\App\Models\Lookup\CommentType::class, 'type_id');
46
    }
47
}
48