Reply   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 32
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A topic() 0 4 1
A user() 0 4 1
A getPresenterClass() 0 4 1
1
<?php
2
3
namespace PHPHub;
4
5
use McCool\LaravelAutoPresenter\HasPresenter;
6
use PHPHub\Presenters\ReplyPresenter;
7
use Illuminate\Database\Eloquent\Model;
8
9
class Reply extends Model implements HasPresenter
10
{
11
    public static $includable = ['id', 'body', 'body_original', 'vote_count'];
12
    protected $fillable = ['body', 'topic_id'];
13
14
    protected $casts = [
15
        'user_id'    => 'int',
16
        'topic_id'   => 'int',
17
        'is_block'   => 'boolean',
18
        'vote_count' => 'int',
19
    ];
20
21
    public function topic()
22
    {
23
        return $this->belongsTo(Topic::class);
24
    }
25
26
    public function user()
27
    {
28
        return $this->belongsTo(User::class);
29
    }
30
31
    /**
32
     * Get the presenter class.
33
     *
34
     * @return string
35
     */
36
    public function getPresenterClass()
37
    {
38
        return ReplyPresenter::class;
39
    }
40
}
41