Passed
Push — master ( 13eaee...8f1b0b )
by Zhengchao
17:36
created

Follower   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 23
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A followable() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of questocat/laravel-rally package.
5
 *
6
 * (c) questocat <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Questocat\Rally\Models;
13
14
use Illuminate\Database\Eloquent\Model;
15
16
class Follower extends Model
17
{
18
    /**
19
     * Follower construct.
20
     *
21
     * @param array $attributes
22
     */
23
    public function __construct(array $attributes = [])
24
    {
25
        $this->table = config('rally.followable_table', 'followables');
26
        parent::__construct($attributes);
27
    }
28
29
    /**
30
     * Returns the entity that followed this entity.
31
     *
32
     * @return \Illuminate\Database\Eloquent\Model
33
     */
34
    public function followable()
35
    {
36
        return $this->morphTo(config('rally.followable_prefix', 'followable'));
37
    }
38
}
39