-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4100 from morozov/rename-driver-classes
Deprecate inconsistently and ambiguously named driver-level classes
- Loading branch information
Showing
99 changed files
with
995 additions
and
403 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\DBAL\Driver; | ||
|
||
use Exception as BaseException; | ||
|
||
/** | ||
* Base implementation of the {@link Exception} interface. | ||
* | ||
* @internal | ||
* | ||
* @psalm-immutable | ||
*/ | ||
abstract class AbstractException extends BaseException implements DriverException | ||
{ | ||
/** | ||
* The driver specific error code. | ||
* | ||
* @var int|string|null | ||
*/ | ||
private $errorCode; | ||
|
||
/** | ||
* The SQLSTATE of the driver. | ||
* | ||
* @var string|null | ||
*/ | ||
private $sqlState; | ||
|
||
/** | ||
* @param string $message The driver error message. | ||
* @param string|null $sqlState The SQLSTATE the driver is in at the time the error occurred, if any. | ||
* @param int|string|null $errorCode The driver specific error code if any. | ||
*/ | ||
public function __construct($message, $sqlState = null, $errorCode = null) | ||
{ | ||
parent::__construct($message); | ||
|
||
$this->errorCode = $errorCode; | ||
$this->sqlState = $sqlState; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getErrorCode() | ||
{ | ||
return $this->errorCode; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getSQLState() | ||
{ | ||
return $this->sqlState; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.