Follower::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 0
cts 4
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 2
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