Passed
Push — master ( 41d678...efa1e7 )
by Mr
02:21
created

Exception::errorLog()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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