SubCategoryTranslations
last analyzed

Complexity

Total Complexity 0

Size/Duplication

Total Lines 26
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 0
lcom 0
cbo 2
dl 26
loc 26
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
2
3
namespace App;
4
5
use App\Libraries\WithoutTimestampsModel;
6
use Cviebrock\EloquentSluggable\SluggableInterface;
7
use Cviebrock\EloquentSluggable\SluggableTrait;
8
9 View Code Duplication
class SubCategoryTranslations
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
10
    extends WithoutTimestampsModel
0 ignored issues
show
Coding Style introduced by
The extends keyword must be on the same line as the class name
Loading history...
Coding Style introduced by
Expected 0 spaces between "WithoutTimestampsModel" and comma; 1 found
Loading history...
11
    implements SluggableInterface
0 ignored issues
show
Coding Style introduced by
The implements keyword must be on the same line as the class name
Loading history...
12
{
13
    use SluggableTrait;
14
15
    /**
16
     * @var string
17
     */
18
    protected $table = 'sub_category_translations';
19
20
    /**
21
     * @var array
22
     */
23
    protected $fillable = [
24
        'name', 'slug', 'seo_title', 'seo_description', 'seo_keywords'
25
    ];
26
27
    /**
28
     * @var array
29
     */
30
    protected $sluggable = array(
31
        'build_from' => 'name',
32
        'save_to'    => 'slug'
33
    );
34
}
35