Total Complexity | 8 |
Total Lines | 58 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class VocabTerm extends Model |
||
8 | { |
||
9 | protected $casts = [ |
||
10 | 'translation' => 'json', |
||
11 | ]; |
||
12 | protected $fillable = [ |
||
13 | 'term', 'translation', 'namespace', |
||
14 | ]; |
||
15 | |||
16 | public function __construct(array $attributes = []) |
||
17 | { |
||
18 | $connection = config('trans-helper.database.connection') ?: config('database.default'); |
||
19 | $this->setConnection($connection); |
||
20 | $this->setTable('_trans_helper_terms'); |
||
21 | parent::__construct($attributes); |
||
22 | } |
||
23 | |||
24 | public function cites() |
||
33 | ); |
||
34 | } |
||
35 | |||
36 | public function getSlugAttribute($attr) |
||
41 | } |
||
42 | |||
43 | public function sweep() |
||
44 | { |
||
45 | if ($this->cites()->count() < 1) { |
||
46 | $this->delete(); |
||
47 | } |
||
48 | } |
||
49 | |||
50 | public static function namespaces() |
||
53 | } |
||
54 | |||
55 | public static function locales() |
||
65 | ) |
||
66 | ) |
||
70 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.