Passed
Push — master ( c430e0...09e8fc )
by Davide
02:42 queued 11s
created

EventCategory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 7
dl 0
loc 30
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCategoryName() 0 5 1
1
<?php
2
3
namespace DavideCasiraghi\LaravelEventsCalendar\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class EventCategory extends Model
8
{
9
    /***************************************************************************/
10
    /**
11
     * The table associated with the model.
12
     *
13
     * @var string
14
     */
15
    protected $table = 'event_categories';
16
17
    /***************************************************************************/
18
19
    use \Dimsav\Translatable\Translatable;
0 ignored issues
show
Bug introduced by
The type Dimsav\Translatable\Translatable was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
20
21
    public $translatedAttributes = ['name', 'slug'];
22
    protected $fillable = [];
23
24
    /***************************************************************************/
25
26
    /**
27
     * Return the category name.
28
     *
29
     * @param  int  $categoryId
30
     * @return string
31
     */
32
    public static function getCategoryName($categoryId)
33
    {
34
        $ret = self::find($categoryId)->name;
35
36
        return $ret;
37
    }
38
}
39