Passed
Push — master ( ad698b...e83e7e )
by Peter
02:16
created

Database::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 8
rs 10
cc 2
nc 2
nop 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Admin\Exception;
6
7
use RuntimeException;
8
use Throwable;
9
10
class Database extends RuntimeException
11
{
12
    /**
13
     * Database constructor.
14
     *
15
     * @param array          $errorInfo
16
     * @param int            $code
17
     * @param Throwable|null $previous
18
     */
19
    public function __construct(
20
        array $errorInfo = [],
21
        int $code = 0,
22
        Throwable $previous = null
23
    ) {
24
        $message = isset($errorInfo[2]) ? $errorInfo[2] : print_r($errorInfo, true);
25
26
        parent::__construct($message, $code, $previous);
27
    }
28
}
29