NoTranslatorFound   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 22
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A forCountry() 0 9 1
A forLocale() 0 9 1
1
<?php
2
3
namespace HansOtt\Holiday;
4
5
use Exception;
6
7
final class NoTranslatorFound extends Exception
8
{
9 2
    public static function forCountry($alpha3)
10
    {
11 2
        return new static(
12 2
            sprintf(
13 2
                'No translator found for country "%s"',
14
                $alpha3
15 2
            )
16 2
        );
17
    }
18
19 2
    public static function forLocale($locale)
20
    {
21 2
        return new static(
22 2
            sprintf(
23 2
                'No translator found for locale "%s"',
24
                $locale
25 2
            )
26 2
        );
27
    }
28
}
29