Passed
Push — master ( b29a96...ccf9ca )
by Marcio
02:49
created

RouterException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
eloc 6
c 1
b 0
f 1
dl 0
loc 21
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 2
1
<?php
2
/**
3
 *
4
 * KNUT7 K7F (https://marciozebedeu.com/)
5
 * KNUT7 K7F (tm) : Rapid Development Framework (https://marciozebedeu.com/)
6
 *
7
 * Licensed under The MIT License
8
 * For full copyright and license information, please see the LICENSE.txt
9
 * Redistributions of files must retain the above copyright notice.
10
 *
11
 * @link      https://github.com/knut7/framework/ for the canonical source repository
12
 * @copyright (c) 2015.  KNUT7  Software Technologies AO Inc. (https://marciozebedeu.com/)
13
 * @license   https://marciozebedeu.com/license/new-bsd New BSD License
14
 * @author    Marcio Zebedeu - [email protected]
15
 * @version   1.0.14
16
 *
17
 *
18
 */
19
20
namespace Ballybran\Routing\Router;
21
22
use Exception;
23
24
class RouterException
25
{
26
    /**
27
     * @var bool $debug Debug mode
28
     */
29
    public static $debug = false;
30
31
    /**
32
     * Create Exception Class.
33
     *
34
     * @param $message
35
     *
36
     * @return string
37
     * @throws Exception
38
     */
39
    public function __construct($message)
40
    {
41
        if (self::$debug) {
42
            throw new Exception($message, 1);
43
        } else {
44
            die('<h2>Opps! An error occurred.</h2> ' . $message);
1 ignored issue
show
Best Practice introduced by
Using exit here is not recommended.

In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.

Loading history...
45
        }
46
    }
47
}
48