AttributeIsNotTranslatable   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 9
ccs 0
cts 5
cp 0
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 LaTevaWeb\Translatable\Exceptions;
4
5
use Exception;
6
use Illuminate\Database\Eloquent\Model;
7
8
class AttributeIsNotTranslatable extends Exception
9
{
10
    public static function make(string $field, Model $model)
11
    {
12
        $translatableAttributes = implode(', ', $model->getTranslatableAttributes());
13
14
        return new static("Cannot translate attribute `{$field}` as it's not one of the translatable attributes: `$translatableAttributes`");
15
    }
16
}
17