Passed
Push — master ( f289b8...9f5103 )
by Davide
72:35 queued 38:03
created

EventCategory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 8
c 1
b 0
f 0
dl 0
loc 31
ccs 3
cts 3
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCategoryName() 0 5 1
1
<?php
2
3
namespace DavideCasiraghi\LaravelEventsCalendar\Models;
4
5
use Astrotomic\Translatable\Translatable;
6
use Illuminate\Database\Eloquent\Model;
7
8
class EventCategory extends Model
9
{
10
    /***************************************************************************/
11
    /**
12
     * The table associated with the model.
13
     *
14
     * @var string
15
     */
16
    protected $table = 'event_categories';
17
18
    /***************************************************************************/
19
20
    use Translatable;
0 ignored issues
show
Bug introduced by
The trait Astrotomic\Translatable\Translatable requires the property $each which is not provided by DavideCasiraghi\LaravelE...ar\Models\EventCategory.
Loading history...
21
22
    public $translatedAttributes = ['name', 'slug'];
23
    protected $fillable = [];
24
    public $useTranslationFallback = true;
25
26
    /***************************************************************************/
27
28
    /*
29
     * Return the category name.
30
     *
31
     * @param  int  $categoryId
32
     * @return string
33
     */
34 1
    public static function getCategoryName($categoryId)
35
    {
36 1
        $ret = self::find($categoryId)->name;
37
38 1
        return $ret;
39
    }
40
}
41