CurrencyNotDefined::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
1
<?php
2
3
namespace ICanBoogie\CLDR\Numbers;
4
5
use ICanBoogie\CLDR\Exception;
6
use InvalidArgumentException;
7
use Throwable;
8
9
/**
10
 * Exception thrown when a currency is not defined.
11
 */
12
class CurrencyNotDefined extends InvalidArgumentException implements Exception
13
{
14
    /**
15
     * @param string $currency_code
16
     *     A currency code; for example, EUR.
17
     */
18
    public function __construct(
19
        public readonly string $currency_code,
20
        ?string $message = null,
21
        ?Throwable $previous = null
22
    ) {
23
        $message ??= "Currency code is not defined: $currency_code";
24
25
        parent::__construct($message, previous: $previous);
26
    }
27
}
28