InternalNameException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 11
dl 0
loc 48
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 3 1
A __construct() 0 7 2
1
<?php
2
3
namespace Source\Core\Exception;
4
5
use Exception;
6
7
final class InternalNameException extends Exception implements ExceptionInterface
8
{
9
    /**
10
     * Exception message
11
     */
12
    protected $message = "";
13
14
    /**
15
     * Unknown
16
     */
17
    private $string;
0 ignored issues
show
introduced by
The private property $string is not used, and could be removed.
Loading history...
18
19
    /**
20
     * User-defined exception code
21
     */
22
    protected $code = 0;
23
24
    /**
25
     * Source filename of exception
26
     */
27
    protected $file;
28
29
    /**
30
     * Source line of exception
31
     */
32
    protected $line;
33
34
    /**
35
     * Unknown
36
     */
37
    private $trace;
0 ignored issues
show
introduced by
The private property $trace is not used, and could be removed.
Loading history...
38
39
    /**
40
     * @var string $message
41
     * @var int $code
42
     */
43
    public function __construct(string $message = null, int $code = 0)
44
    {
45
        if (!$message) {
46
            throw new $this('Unknown ' . get_class($this));
47
        }
48
49
        parent::__construct($message, $code);
50
    }
51
52
    public function __toString()
53
    {
54
        return get_class($this) . " '{$this->message}' in {$this->file}({$this->line})\n" . "{$this->getTraceAsString()}";
55
    }
56
}
57