Locale   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A guard() 0 8 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpValueObjects\Geography;
6
7
use PhpValueObjects\AbstractValueObject;
8
use Symfony\Component\Intl\Exception\MissingResourceException;
9
use Symfony\Component\Intl\Locales;
10
11
abstract class Locale extends AbstractValueObject
12
{
13 18
    protected function guard($value): void
14
    {
15
        try {
16 18
            Locales::getName($value);
17 6
        } catch (MissingResourceException $exception) {
18 6
            $this->throwException($value);
19
        }
20 12
    }
21
}
22