Exception::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
nc 1
nop 3
dl 0
loc 8
c 0
b 0
f 0
cc 1
rs 9.4285
1
<?php
2
3
namespace DrMVC\Framework;
4
5
/**
6
 * Class Exception
7
 * @package DrMVC\Framework
8
 * @since   3.0
9
 */
10
class Exception extends \Exception
11
{
12
    public function __construct(string $message = '', int $code = 0, \Throwable $previous = null)
13
    {
14
        parent::__construct($message, $code, $previous);
15
16
        error_log(
17
            'Uncaught Error: ' . $this->getMessage() . ' in ' . $this->getFile() . ':' . $this->getLine() . "\n"
18
            . "Stack trace:\n" . $this->getTraceAsString() . "\n"
19
            . '  thrown in ' . $this->getFile() . ' on line ' . $this->getLine()
20
        );
21
    }
22
}
23