Total Complexity | 9 |
Total Lines | 59 |
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(config('trans-helper.database.table.term')); |
||
21 | parent::__construct($attributes); |
||
22 | } |
||
23 | |||
24 | public function cites() |
||
33 | ); |
||
34 | } |
||
35 | |||
36 | public function getSlugAttribute($attr) |
||
42 | } |
||
43 | |||
44 | public function sweep() |
||
45 | { |
||
46 | if ($this->cites()->count() < 1) { |
||
47 | $this->delete(); |
||
48 | } |
||
49 | } |
||
50 | |||
51 | public static function namespaces() |
||
54 | } |
||
55 | |||
56 | public static function locales() |
||
66 | ) |
||
67 | ) |
||
71 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.