Exceptions::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Infinitypaul\NairaExchangeRates\Exceptions;
4
5
use Exception;
6
7
class Exceptions extends Exception
8
{
9
    // Error messages:
10
    /**
11
     * @var array
12
     */
13
    private static $_errors = [
14
        'format.invalid_date'          => 'The specified date is invalid. Please use ISO 8601 notation (e.g. YYYY-MM-DD).',
15
        'format.invalid_currency_code' => 'The specified currency code is invalid. Please use ISO 4217 notation (e.g. USD).',
16
        'format.unsupported_currency'  => 'The specified currency code is not currently supported.',
17
        'format.unsupported_type'      => 'The Specified Types Is Currently Not Supported',
18
        'format.is_null'      => 'The Access Token can not be null. Please pass it to the constructor',
19
    ];
20
21
    public static function create($message)
22
    {
23
        return new static(self::$_errors[$message]);
24
    }
25
}
26