AttributeIsNotTranslatable   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 9
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A make() 0 6 1
1
<?php
2
3
namespace Spatie\Translatable\Exceptions;
4
5
use Exception;
6
use Illuminate\Database\Eloquent\Model;
7
8
class AttributeIsNotTranslatable extends Exception
9
{
10
    public static function make($key, Model $model)
11
    {
12
        $translatable = implode(', ', $model->getTranslatableAttributes());
13
14
        return new static("Cannot translate attribute `{$key}` as it's not one of the translatable attributes: `$translatable`");
15
    }
16
}
17