ActiveLocalesNotDefinedException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 0
f 0
dl 0
loc 16
ccs 0
cts 4
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
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