Counterable   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 7
c 1
b 0
f 0
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A counter() 0 3 1
1
<?php
2
namespace Turahe\Counters\Models;
3
4
use Illuminate\Database\Eloquent\Model;
5
6
/**
7
 * Turahe\Counters\Models\Counterable
8
 *
9
 * @property int $id
10
 * @property string $counterable_type
11
 * @property int $counterable_id
12
 * @property int $counter_id
13
 * @property float $value
14
 * @property \Illuminate\Support\Carbon|null $created_at
15
 * @property \Illuminate\Support\Carbon|null $updated_at
16
 * @property-read \Turahe\Counters\Models\Counter $counter
17
 * @method static \Illuminate\Database\Eloquent\Builder|Counterable newModelQuery()
18
 * @method static \Illuminate\Database\Eloquent\Builder|Counterable newQuery()
19
 * @method static \Illuminate\Database\Eloquent\Builder|Counterable query()
20
 * @method static \Illuminate\Database\Eloquent\Builder|Counterable whereCounterId($value)
21
 * @method static \Illuminate\Database\Eloquent\Builder|Counterable whereCounterableId($value)
22
 * @method static \Illuminate\Database\Eloquent\Builder|Counterable whereCounterableType($value)
23
 * @method static \Illuminate\Database\Eloquent\Builder|Counterable whereCreatedAt($value)
24
 * @method static \Illuminate\Database\Eloquent\Builder|Counterable whereId($value)
25
 * @method static \Illuminate\Database\Eloquent\Builder|Counterable whereUpdatedAt($value)
26
 * @method static \Illuminate\Database\Eloquent\Builder|Counterable whereValue($value)
27
 * @mixin \Eloquent
28
 */
29
class Counterable extends Model
30
{
31
    /**
32
     * @var string[]
33
     */
34
    protected $fillable = [
35
        'value',
36
        'counter_id',
37
        'counterable_id',
38
        'counterable_type',
39
    ];
40
41
    /**
42
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
43
     */
44
    public function counter()
45
    {
46
        return $this->belongsTo(Counter::class);
47
    }
48
}
49