ActiveLocalesNotDefinedException::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 7
ccs 0
cts 4
cp 0
rs 10
cc 2
nc 2
nop 1
crap 6
1
<?php
2
/**
3
 * Active Locales Not Defined Exception.
4
 *
5
 * @package App\Exceptions\Localization
6
 *
7
 * @author    Nick Menke <[email protected]>
8
 * @copyright 2018-2020 Nick Menke
9
 *
10
 * @link https://github.com/nlmenke/vertebrae
11
 */
12
13
declare(strict_types=1);
14
15
namespace App\Exceptions\Localization;
16
17
use Exception;
18
19
/**
20
 * The Active Locales Not Defined exception class.
21
 *
22
 * This exception class notifies the user if the application does not have any
23
 * active locales. If you're getting this exception, you may need to seed your
24
 * database or make sure at least one (1) locale as active.
25
 *
26
 * @since x.x.x introduced
27
 */
28
class ActiveLocalesNotDefinedException extends Exception
29
{
30
    /**
31
     * Create a new exception instance.
32
     *
33
     * @param string $message
34
     *
35
     * @return void
36
     */
37
    public function __construct(string $message = null)
38
    {
39
        if ($message === null) {
40
            $message = trans('exceptions.active_locales_not_defined');
41
        }
42
43
        parent::__construct($message);
44
    }
45
}
46