Total Complexity | 3 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Coverage | 77.78% |
Changes | 0 |
1 | <?php |
||
11 | abstract class AbstractDriverException extends Exception implements DriverException |
||
12 | { |
||
13 | /** |
||
14 | * The driver specific error code. |
||
15 | * |
||
16 | * @var int|string|null |
||
17 | */ |
||
18 | private $errorCode; |
||
19 | |||
20 | /** |
||
21 | * The SQLSTATE of the driver. |
||
22 | * |
||
23 | * @var string|null |
||
24 | */ |
||
25 | private $sqlState; |
||
26 | |||
27 | /** |
||
28 | * @param string $message The driver error message. |
||
29 | * @param string|null $sqlState The SQLSTATE the driver is in at the time the error occurred, if any. |
||
30 | * @param int|string|null $errorCode The driver specific error code if any. |
||
31 | * @param Throwable|null $previous The previous exception. |
||
32 | */ |
||
33 | 1075 | public function __construct( |
|
34 | $message, |
||
35 | $sqlState = null, |
||
36 | $errorCode = null, |
||
37 | Throwable $previous = null |
||
38 | ) { |
||
39 | 1075 | parent::__construct($message, 0, $previous); |
|
40 | |||
41 | 1075 | $this->errorCode = $errorCode; |
|
42 | 1075 | $this->sqlState = $sqlState; |
|
43 | 1075 | } |
|
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | 927 | public function getErrorCode() |
|
49 | { |
||
50 | 927 | return $this->errorCode; |
|
51 | } |
||
52 | |||
53 | /** |
||
54 | * {@inheritdoc} |
||
55 | */ |
||
56 | public function getSQLState() |
||
59 | } |
||
60 | } |
||
61 |