Completed
Push — master ( 9697ab...60ecca )
by Mike
11:00 queued 04:55
created

UncachedBook   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 100 %

Importance

Changes 0
Metric Value
wmc 2
dl 20
loc 20
rs 10
c 0
b 0
f 0

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php namespace GeneaLabs\LaravelModelCaching\Tests\Fixtures;
2
3
use GeneaLabs\LaravelModelCaching\CachedModel;
4
use Illuminate\Database\Eloquent\Relations\BelongsTo;
5
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
6
7
class UncachedBook extends CachedModel
8
{
9
    protected $dates = [
10
        'published_at',
11
    ];
12
    protected $fillable = [
13
        'description',
14
        'published_at',
15
        'title',
16
    ];
17
    protected $table = 'books';
18
19
    public function author() : BelongsTo
20
    {
21
        return $this->belongsTo(UncachedAuthor::class);
22
    }
23
24
    public function stores() : BelongsToMany
25
    {
26
        return $this->belongsToMany(UncachedStore::class);
27
    }
28
}
29