Failed Conditions
Push — master ( ac0e13...24dbc4 )
by Sergei
22s queued 15s
created

src/Driver/Mysqli/Exception/ConnectionError.php (1 issue)

Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\DBAL\Driver\Mysqli\Exception;
6
7
use Doctrine\DBAL\Driver\Mysqli\MysqliException;
8
use mysqli;
9
10
final class ConnectionError extends MysqliException
11
{
12
    public static function new(mysqli $connection) : self
13
    {
14
        $connectionSQLState = $connection->sqlstate;
15
16
        $sqlState = null;
17
        if ($connectionSQLState !== false) {
0 ignored issues
show
The condition $connectionSQLState !== false is always true.
Loading history...
18
            $sqlState = $connectionSQLState;
19
        }
20
21
        return new self($connection->error, $sqlState, $connection->errno);
22
    }
23
}
24