CountryStrict
last analyzed

Complexity

Total Complexity 0

Size/Duplication

Total Lines 44
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 0
c 0
b 0
f 0
lcom 0
cbo 2
dl 44
loc 44

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 Dimsav\Translatable\Test\Model;
4
5
use Dimsav\Translatable\Translatable;
6
use Illuminate\Database\Eloquent\Model as Eloquent;
7
8 View Code Duplication
class CountryStrict extends Eloquent
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...
9
{
10
    use Translatable;
11
12
    /**
13
     * Array with the fields translated in the Translation table.
14
     *
15
     * @var array
16
     */
17
    public $translatedAttributes = ['name'];
18
19
    /**
20
     * Here we set a custom model for translation.
21
     * The convention would be Dimsav\Translatable\Test\Model\CountryStrictTranslation.
22
     *
23
     * @var string Class containing the translation
24
     */
25
    public $translationModel = 'Dimsav\Translatable\Test\Model\StrictTranslation';
26
27
    /**
28
     * @var string Foreign key for the translation relationship
29
     */
30
    public $translationForeignKey = 'country_id';
31
32
    /**
33
     * Column containing the locale in the translation table.
34
     * Defaults to 'locale'.
35
     *
36
     * @var string
37
     */
38
    public $localeKey;
39
40
    public $table = 'countries';
41
42
    /**
43
     * Add your translated attributes here if you want
44
     * fill them with mass assignment.
45
     *
46
     * @var array
47
     */
48
    public $fillable = ['code'];
49
50
    protected $softDelete = true;
51
}
52