From f01c923dfb29879025fcbed373efaa5a78ea22d4 Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Fri, 26 Jun 2020 13:19:35 -0700 Subject: [PATCH] Deprecate DriverException::getErrorCode() --- UPGRADE.md | 4 ++++ lib/Doctrine/DBAL/Driver/Exception.php | 2 ++ 2 files changed, 6 insertions(+) diff --git a/UPGRADE.md b/UPGRADE.md index 09e7ac5f941..34448db1a80 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,5 +1,9 @@ # Upgrade to 2.11 +## `DriverException::getErrorCode()` is deprecated + +The `DriverException::getErrorCode()` is deprecated as redundant and inconsistently supported by drivers. Use `::getCode()` or `::getSQLState()` instead. + ## Non-interface driver methods have been marked internal The non-interface methods of driver-level classes have been marked internal: diff --git a/lib/Doctrine/DBAL/Driver/Exception.php b/lib/Doctrine/DBAL/Driver/Exception.php index f65591f90ca..a16db4f8adc 100644 --- a/lib/Doctrine/DBAL/Driver/Exception.php +++ b/lib/Doctrine/DBAL/Driver/Exception.php @@ -14,6 +14,8 @@ interface Exception extends Throwable /** * Returns the driver specific error code if available. * + * @deprecated Use {@link getCode()} or {@link getSQLState()} instead + * * Returns null if no driver specific error code is available * for the error raised by the driver. *