SimpleDIException::make()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 3

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 4
nc 2
nop 1
crap 3
1
<?php namespace SimpleDI\Exception;
2
3
use Exception;
4
5
/**
6
 * Basic exception
7
 *
8
 * @package    SimpleDI
9
 * @author     Kai Hempel <[email protected]>
10
 * @copyright  2015 Kai Hempel <[email protected]>
11
 * @license    http://www.opensource.org/licenses/BSD-3-Clause  The BSD 3-Clause License
12
 * @link       https://www.kuweh.de/
13
 * @since      Class available since Release 1.0.0
14
 */
15
class SimpleDIException extends Exception
16
{
17
18
    /**
19
     * Returns the exception object.
20
     *
21
     * @param   string $message
22
     * @return  \Dbrouter\Exception\DbrouterException
23
     */
24 5
    public static function make($message = null)
25
    {
26 5
        if (empty($message) || ! is_string($message)) {
27 1
            $message = 'Unknown exception';
28 1
        }
29
30 5
        return new static($message);
31
    }
32
}
33