Issues (104)

src/Exception/Database.php (1 issue)

Labels
Severity
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 Throwable|null $previous
17
     */
18
    public function __construct(
19
        array $errorInfo = [],
20
        Throwable $previous = null
21
    ) {
22
        $message = $errorInfo[2] ?? print_r($errorInfo, true);
23
        $code    = $errorInfo[1] ?? 0;
24
25
        parent::__construct($message, $code, $previous);
0 ignored issues
show
It seems like $message can also be of type true; however, parameter $message of Exception::__construct() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

25
        parent::__construct(/** @scrutinizer ignore-type */ $message, $code, $previous);
Loading history...
26
    }
27
}
28