Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated Connection::project(), Statement::errorCode() and errorInfo() #4020

Merged
merged 1 commit into from
May 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# Upgrade to 2.11

## Deprecated `Connection::project()`

The `Connection::project()` method is deprecated. Implement data transformation outside of DBAL.

## Deprecated `Statement::errorCode()` and `errorInfo()`

The `Statement::errorCode()` and `errorInfo()` methods are deprecated. The error information is available via exceptions.

## Deprecated `EchoSQLLogger`

The `EchoSQLLogger` is has been deprecated. Implement your logger with the desired logic.
The `EchoSQLLogger` class is deprecated. Implement your logger with the desired logic.

## Deprecated database platforms:

Expand Down
6 changes: 6 additions & 0 deletions lib/Doctrine/DBAL/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,8 @@ public function executeCacheQuery($query, $params, $types, QueryCacheProfile $qc
* Executes an, optionally parametrized, SQL query and returns the result,
* applying a given projection/transformation function on each row of the result.
*
* @deprecated
*
* @param string $query The SQL query to execute.
* @param mixed[] $params The parameters, if any.
* @param Closure $function The transformation function that is applied on each row.
Expand Down Expand Up @@ -1123,6 +1125,8 @@ public function getTransactionNestingLevel()
/**
* Fetches the SQLSTATE associated with the last database operation.
*
* @deprecated The error information is available via exceptions.
*
* @return string|null The last error code.
*/
public function errorCode()
Expand All @@ -1132,6 +1136,8 @@ public function errorCode()

/**
* {@inheritDoc}
*
* @deprecated The error information is available via exceptions.
*/
public function errorInfo()
{
Expand Down
4 changes: 4 additions & 0 deletions lib/Doctrine/DBAL/Driver/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,17 @@ public function rollBack();
/**
* Returns the error code associated with the last operation on the database handle.
*
* @deprecated The error information is available via exceptions.
*
* @return string|null The error code, or null if no operation has been run on the database handle.
*/
public function errorCode();

/**
* Returns extended error information associated with the last operation on the database handle.
*
* @deprecated The error information is available via exceptions.
*
* @return mixed[]
*/
public function errorInfo();
Expand Down
4 changes: 4 additions & 0 deletions lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ public function rollBack()

/**
* {@inheritdoc}
*
* @deprecated The error information is available via exceptions.
*/
public function errorCode()
{
Expand All @@ -188,6 +190,8 @@ public function errorCode()

/**
* {@inheritdoc}
*
* @deprecated The error information is available via exceptions.
*/
public function errorInfo()
{
Expand Down
4 changes: 4 additions & 0 deletions lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ public function columnCount()

/**
* {@inheritdoc}
*
* @deprecated The error information is available via exceptions.
*/
public function errorCode()
{
Expand All @@ -175,6 +177,8 @@ public function errorCode()

/**
* {@inheritdoc}
*
* @deprecated The error information is available via exceptions.
*/
public function errorInfo()
{
Expand Down
4 changes: 4 additions & 0 deletions lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ public function rollBack()

/**
* {@inheritdoc}
*
* @deprecated The error information is available via exceptions.
*/
public function errorCode()
{
Expand All @@ -208,6 +210,8 @@ public function errorCode()

/**
* {@inheritdoc}
*
* @deprecated The error information is available via exceptions.
*/
public function errorInfo()
{
Expand Down
4 changes: 4 additions & 0 deletions lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,8 @@ public function fetchColumn($columnIndex = 0)

/**
* {@inheritdoc}
*
* @deprecated The error information is available via exceptions.
*/
public function errorCode()
{
Expand All @@ -401,6 +403,8 @@ public function errorCode()

/**
* {@inheritdoc}
*
* @deprecated The error information is available via exceptions.
*/
public function errorInfo()
{
Expand Down
4 changes: 4 additions & 0 deletions lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ public function rollBack()

/**
* {@inheritdoc}
*
* @deprecated The error information is available via exceptions.
*/
public function errorCode()
{
Expand All @@ -229,6 +231,8 @@ public function errorCode()

/**
* {@inheritdoc}
*
* @deprecated The error information is available via exceptions.
*/
public function errorInfo()
{
Expand Down
4 changes: 4 additions & 0 deletions lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,8 @@ public function columnCount()

/**
* {@inheritdoc}
*
* @deprecated The error information is available via exceptions.
*/
public function errorCode()
{
Expand All @@ -365,6 +367,8 @@ public function errorCode()

/**
* {@inheritdoc}
*
* @deprecated The error information is available via exceptions.
*/
public function errorInfo()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ public function commit()

/**
* {@inheritdoc}
*
* @deprecated The error information is available via exceptions.
*/
public function errorCode()
{
Expand All @@ -98,6 +100,8 @@ public function errorCode()

/**
* {@inheritdoc}
*
* @deprecated The error information is available via exceptions.
*/
public function errorInfo()
{
Expand Down
4 changes: 4 additions & 0 deletions lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ public function columnCount()

/**
* {@inheritdoc}
*
* @deprecated The error information is available via exceptions.
*/
public function errorCode()
{
Expand All @@ -160,6 +162,8 @@ public function errorCode()

/**
* {@inheritdoc}
*
* @deprecated The error information is available via exceptions.
*/
public function errorInfo()
{
Expand Down
4 changes: 4 additions & 0 deletions lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ public function rollBack()

/**
* {@inheritDoc}
*
* @deprecated The error information is available via exceptions.
*/
public function errorCode()
{
Expand All @@ -195,6 +197,8 @@ public function errorCode()

/**
* {@inheritDoc}
*
* @deprecated The error information is available via exceptions.
*/
public function errorInfo()
{
Expand Down
4 changes: 4 additions & 0 deletions lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ public function columnCount()

/**
* {@inheritdoc}
*
* @deprecated The error information is available via exceptions.
*/
public function errorCode()
{
Expand All @@ -229,6 +231,8 @@ public function errorCode()

/**
* {@inheritdoc}
*
* @deprecated The error information is available via exceptions.
*/
public function errorInfo()
{
Expand Down
4 changes: 4 additions & 0 deletions lib/Doctrine/DBAL/Driver/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public function bindParam($column, &$variable, $type = ParameterType::STRING, $l
/**
* Fetches the SQLSTATE associated with the last operation on the statement handle.
*
* @deprecated The error information is available via exceptions.
*
* @see Doctrine_Adapter_Interface::errorCode()
*
* @return string|int|bool The error code string.
Expand All @@ -70,6 +72,8 @@ public function errorCode();
/**
* Fetches extended error information associated with the last operation on the statement handle.
*
* @deprecated The error information is available via exceptions.
*
* @return mixed[] The error info array.
*/
public function errorInfo();
Expand Down
4 changes: 4 additions & 0 deletions lib/Doctrine/DBAL/Portability/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ public function columnCount()

/**
* {@inheritdoc}
*
* @deprecated The error information is available via exceptions.
*/
public function errorCode()
{
Expand All @@ -91,6 +93,8 @@ public function errorCode()

/**
* {@inheritdoc}
*
* @deprecated The error information is available via exceptions.
*/
public function errorInfo()
{
Expand Down
4 changes: 4 additions & 0 deletions lib/Doctrine/DBAL/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ public function columnCount()
/**
* Fetches the SQLSTATE associated with the last operation on the statement.
*
* @deprecated The error information is available via exceptions.
*
* @return string|int|bool
*/
public function errorCode()
Expand All @@ -207,6 +209,8 @@ public function errorCode()

/**
* {@inheritDoc}
*
* @deprecated The error information is available via exceptions.
*/
public function errorInfo()
{
Expand Down