Completed
Pull Request — master (#140)
by ARCANEDEV
08:35
created

UntranslatableAttributeException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A make() 0 8 1
1
<?php namespace Arcanedev\Localization\Exceptions;
2
3
/**
4
 * Class     UntranslatableAttributeException
5
 *
6
 * @package  Arcanedev\Localization\Exceptions
7
 * @author   ARCANEDEV <[email protected]>
8
 */
9
class UntranslatableAttributeException extends LocalizationException 
10
{
11 4
    public static function make(string $key, array $translatableAttributes)
12
    {
13 4
        $translatableAttributes = implode(', ', $translatableAttributes);
14
15 4
        return new static(
16 4
            "The attribute `{$key}` is untranslatable because it's not available in the translatable array: `$translatableAttributes`"
17
        );
18
    }
19
}
20