Passed
Push — 6.0 ( 4ac4e1...87e1d7 )
by Olivier
01:56
created

TerritoryNotDefined   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 3
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
1
<?php
2
3
namespace ICanBoogie\CLDR\Supplemental\Territory;
4
5
use ICanBoogie\CLDR\Exception;
6
use InvalidArgumentException;
7
use Throwable;
8
9
/**
10
 * Exception thrown when a territory is not defined.
11
 */
12
final class TerritoryNotDefined extends InvalidArgumentException implements Exception
13
{
14
    /**
15
     * @param string $territory_code
16
     *     The ISO code of the territory.
17
     */
18
    public function __construct(
19
        public readonly string $territory_code,
20
        string $message = null,
21
        Throwable $previous = null
22
    ) {
23
        $message ??= "Territory not defined for code: $territory_code.";
24
25
        parent::__construct($message, 0, $previous);
26
    }
27
}
28