LocaleNotAvailable   A
last analyzed

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\Core;
4
5
use ICanBoogie\CLDR\Exception;
6
use InvalidArgumentException;
7
use Throwable;
8
9
/**
10
 * Exception thrown when a requested locale ID is not available.
11
 *
12
 * @link https://github.com/unicode-org/cldr-json/blob/47.0.0/cldr-json/cldr-core/availableLocales.json
13
 */
14
final class LocaleNotAvailable extends InvalidArgumentException implements Exception
15
{
16
    /**
17
     * @param string $locale_id
18
     *     A locale ID.
19
     */
20
    public function __construct(
21
        public readonly string $locale_id,
22
        ?string $message = null,
23
        ?Throwable $previous = null
24
    ) {
25
        $message ??= "Locale ID is not available: $locale_id";
26
27
        parent::__construct($message, previous: $previous);
28
    }
29
}
30