Passed
Push — master ( 6e44a2...3e59ed )
by Thomas
08:38
created

EnrollmentStatusType   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 14
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A styling() 0 6 1
1
<?php
2
3
namespace App\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Spatie\Translatable\HasTranslations;
7
8
class EnrollmentStatusType extends Model
9
{
10
    use HasTranslations;
11
12
    public array $translatable = ['name'];
13
14
    public $timestamps = false;
15
16
    public function styling()
17
    {
18
        return match($this->id) {
19
            1 => 'warning',
20
            2 => 'info',
21
            default => 'danger',
22
        };
23
    }
24
}
25