Skip to content

Commit

Permalink
Merge 3.2.x into 3.3.x (#5068)
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus authored Dec 2, 2021
2 parents 39d41f0 + 7d0c93a commit e4df1a5
Show file tree
Hide file tree
Showing 59 changed files with 154 additions and 136 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ jobs:
with:
fetch-depth: 2

- name: "Temporarily remove support for PSR Log 3 on PHP 8.1"
run: 'sed -i "s/\"psr\/log\": \"^1|^2|^3\"/\"psr\/log\": \"^1|^2\"/" composer.json'
if: "${{ matrix.php-version=='8.1' }}"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
Expand Down Expand Up @@ -86,10 +82,6 @@ jobs:
with:
fetch-depth: 2

- name: "Temporarily remove support for PSR Log 3 on PHP 8.1"
run: 'sed -i "s/\"psr\/log\": \"^1|^2|^3\"/\"psr\/log\": \"^1|^2\"/" composer.json'
if: "${{ matrix.php-version=='8.1' }}"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
Expand Down Expand Up @@ -133,10 +125,6 @@ jobs:
with:
fetch-depth: 2

- name: "Temporarily remove support for PSR Log 3 on PHP 8.1"
run: 'sed -i "s/\"psr\/log\": \"^1|^2|^3\"/\"psr\/log\": \"^1|^2\"/" composer.json'
if: "${{ matrix.php-version=='8.1' }}"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
Expand Down Expand Up @@ -192,10 +180,6 @@ jobs:
with:
fetch-depth: 2

- name: "Temporarily remove support for PSR Log 3 on PHP 8.1"
run: 'sed -i "s/\"psr\/log\": \"^1|^2|^3\"/\"psr\/log\": \"^1|^2\"/" composer.json'
if: "${{ matrix.php-version=='8.1' }}"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
Expand Down Expand Up @@ -258,10 +242,6 @@ jobs:
with:
fetch-depth: 2

- name: "Temporarily remove support for PSR Log 3 on PHP 8.1"
run: 'sed -i "s/\"psr\/log\": \"^1|^2|^3\"/\"psr\/log\": \"^1|^2\"/" composer.json'
if: "${{ matrix.php-version=='8.1' }}"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
Expand Down Expand Up @@ -350,10 +330,6 @@ jobs:
with:
fetch-depth: 2

- name: "Temporarily remove support for PSR Log 3 on PHP 8.1"
run: 'sed -i "s/\"psr\/log\": \"^1|^2|^3\"/\"psr\/log\": \"^1|^2\"/" composer.json'
if: "${{ matrix.php-version=='8.1' }}"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
Expand Down Expand Up @@ -422,10 +398,6 @@ jobs:
with:
fetch-depth: 2

- name: "Temporarily remove support for PSR Log 3 on PHP 8.1"
run: 'sed -i "s/\"psr\/log\": \"^1|^2|^3\"/\"psr\/log\": \"^1|^2\"/" composer.json'
if: "${{ matrix.php-version=='8.1' }}"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
Expand Down Expand Up @@ -483,10 +455,6 @@ jobs:
with:
fetch-depth: 2

- name: "Temporarily remove support for PSR Log 3 on PHP 8.1"
run: 'sed -i "s/\"psr\/log\": \"^1|^2|^3\"/\"psr\/log\": \"^1|^2\"/" composer.json'
if: "${{ matrix.php-version=='8.1' }}"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
Expand Down
8 changes: 8 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ Call `getNativeConnection()` to access the underlying PDO or MySQLi connection.

# Upgrade to 3.2

## Minor BC Break: using cache keys with characters reserved by `psr/cache`

We have been working on phasing out `doctrine/cache`, and 3.2.0 allows to use
`psr/cache` instead. To help calling our own internal APIs in a unified way, we
also wrap `doctrine/cache` implementations with a `psr/cache` adapter.
Using cache keys containing characters reserved by `psr/cache` will result in
an exception. The characters are the following: `{}()/\@`.

## Deprecated `SQLLogger` and its implementations.

The `SQLLogger` and its implementations `DebugStack` and `LoggerChain` have been deprecated.
Expand Down
39 changes: 39 additions & 0 deletions docs/en/explanation/dc2type-comments.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Doctrine SQL comments
=====================

In some occasions DBAL generates ``DC2Type`` SQL comments in columns of
the databases schemas that is maintained by Doctrine. These comments
have a functional purpose in DBAL.

``DC2`` is a shorthand for Doctrine 2, as opposed to `Doctrine 1
<https://github.com/doctrine/doctrine1>`_,
an ancestor that relied on `the active record pattern
<https://en.wikipedia.org/wiki/Active_record_pattern>`_.

These comments are here to help with reverse engineering. Inside the
DBAL, the schema manager can leverage them to resolve ambiguities when
it comes to determining the correct DBAL type for a given column.

For instance: You are following a `Database First approach
<https://www.doctrine-project.org/projects/doctrine-orm/en/current/tutorials/getting-started-database.html>`_,
and want to use GUIDs in your application while using a platform that does not have a native type for
this mapping.
By commenting columns that hold GUIDs with ``(DC2Type:guid)``, you can
let the DBAL know it is supposed to use ``Doctrine\DBAL\Types\GuidType``
when dealing with that column.
When using reverse engineering tools, this can be used to generate
accurate information.
For instance, if you use Doctrine ORM, there is `a reverse engineering example
<https://www.doctrine-project.org/projects/doctrine-orm/en/current/reference/tools.html#reverse-engineering>`_
to show how to generate a proper mapping.

A table with such a column may have a declaration that looks as follows:

.. code-block:: sql
CREATE TABLE "movies" (
uuid CHAR(36) NOT NULL, --(DC2Type:guid)
title varchar(255) NOT NULL
…,
PRIMARY KEY(uuid)
)
1 change: 1 addition & 0 deletions docs/en/sidebar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@
reference/upgrading
reference/testing

explanation/dc2type-comments.rst
explanation/implicit-indexes
6 changes: 3 additions & 3 deletions src/Cache/ArrayResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
final class ArrayResult implements Result
{
/** @var mixed[] */
/** @var list<array<string, mixed>> */
private $data;

/** @var int */
Expand All @@ -24,7 +24,7 @@ final class ArrayResult implements Result
private $num = 0;

/**
* @param mixed[] $data
* @param list<array<string, mixed>> $data
*/
public function __construct(array $data)
{
Expand Down Expand Up @@ -112,7 +112,7 @@ public function free(): void
}

/**
* @return mixed|false
* @return array<string, mixed>|false
*/
private function fetch()
{
Expand Down
10 changes: 5 additions & 5 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class Connection
protected $_eventManager;

/**
* @deprecated Use {@link createExpressionBuilder()} instead.
* @deprecated Use {@see createExpressionBuilder()} instead.
*
* @var ExpressionBuilder
*/
Expand Down Expand Up @@ -134,7 +134,7 @@ class Connection
/**
* The schema manager.
*
* @deprecated Use {@link createSchemaManager()} instead.
* @deprecated Use {@see createSchemaManager()} instead.
*
* @var AbstractSchemaManager|null
*/
Expand Down Expand Up @@ -294,7 +294,7 @@ public function createExpressionBuilder(): ExpressionBuilder
/**
* Gets the ExpressionBuilder for the connection.
*
* @deprecated Use {@link createExpressionBuilder()} instead.
* @deprecated Use {@see createExpressionBuilder()} instead.
*
* @return ExpressionBuilder
*/
Expand Down Expand Up @@ -796,7 +796,7 @@ public function quoteIdentifier($str)

/**
* The usage of this method is discouraged. Use prepared statements
* or {@link AbstractPlatform::quoteStringLiteral()} instead.
* or {@see AbstractPlatform::quoteStringLiteral()} instead.
*
* @param mixed $value
* @param int|string|Type|null $type
Expand Down Expand Up @@ -1566,7 +1566,7 @@ public function createSchemaManager(): AbstractSchemaManager
* Gets the SchemaManager that can be used to inspect or change the
* database schema through the connection.
*
* @deprecated Use {@link createSchemaManager()} instead.
* @deprecated Use {@see createSchemaManager()} instead.
*
* @return AbstractSchemaManager
*
Expand Down
4 changes: 2 additions & 2 deletions src/Driver/API/ExceptionConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ interface ExceptionConverter
* Converts a given driver-level exception into a DBAL-level driver exception.
*
* Implementors should use the vendor-specific error code and SQLSTATE of the exception
* and instantiate the most appropriate specialized {@link DriverException} subclass.
* and instantiate the most appropriate specialized {@see DriverException} subclass.
*
* @param Exception $exception The driver exception to convert.
* @param Query|null $query The SQL query that triggered the exception, if any.
*
* @return DriverException An instance of {@link DriverException} or one of its subclasses.
* @return DriverException An instance of {@see DriverException} or one of its subclasses.
*/
public function convert(Exception $exception, ?Query $query): DriverException;
}
2 changes: 1 addition & 1 deletion src/Driver/AbstractDB2Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use function assert;

/**
* Abstract base implementation of the {@link Driver} interface for IBM DB2 based drivers.
* Abstract base implementation of the {@see Driver} interface for IBM DB2 based drivers.
*/
abstract class AbstractDB2Driver implements Driver
{
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/AbstractException.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Throwable;

/**
* Base implementation of the {@link Exception} interface.
* Base implementation of the {@see Exception} interface.
*
* @internal
*
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/AbstractMySQLDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use function version_compare;

/**
* Abstract base implementation of the {@link Driver} interface for MySQL based drivers.
* Abstract base implementation of the {@see Driver} interface for MySQL based drivers.
*/
abstract class AbstractMySQLDriver implements VersionAwarePlatformDriver
{
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/AbstractOracleDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use function assert;

/**
* Abstract base implementation of the {@link Driver} interface for Oracle based drivers.
* Abstract base implementation of the {@see Driver} interface for Oracle based drivers.
*/
abstract class AbstractOracleDriver implements Driver
{
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/AbstractPostgreSQLDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use function version_compare;

/**
* Abstract base implementation of the {@link Driver} interface for PostgreSQL based drivers.
* Abstract base implementation of the {@see Driver} interface for PostgreSQL based drivers.
*/
abstract class AbstractPostgreSQLDriver implements VersionAwarePlatformDriver
{
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/AbstractSQLServerDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use function assert;

/**
* Abstract base implementation of the {@link Driver} interface for Microsoft SQL Server based drivers.
* Abstract base implementation of the {@see Driver} interface for Microsoft SQL Server based drivers.
*/
abstract class AbstractSQLServerDriver implements Driver
{
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/AbstractSQLiteDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use function assert;

/**
* Abstract base implementation of the {@link Doctrine\DBAL\Driver} interface for SQLite based drivers.
* Abstract base implementation of the {@see Doctrine\DBAL\Driver} interface for SQLite based drivers.
*/
abstract class AbstractSQLiteDriver implements Driver
{
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function query(string $sql): Result;
* Quotes a string for use in a query.
*
* The usage of this method is discouraged. Use prepared statements
* or {@link AbstractPlatform::quoteStringLiteral()} instead.
* or {@see AbstractPlatform::quoteStringLiteral()} instead.
*
* @param mixed $value
* @param int $type
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/ServerInfoAwareConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
* Contract for a connection that is able to provide information about the server it is connected to.
*
* @deprecated The methods defined in this interface will be made part of the {@link Driver} interface
* @deprecated The methods defined in this interface will be made part of the {@see Driver} interface
* in the next major release.
*/
interface ServerInfoAwareConnection extends Connection
Expand Down
8 changes: 4 additions & 4 deletions src/Driver/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface Statement
* this will be a parameter name of the form :name. For a prepared statement
* using question mark placeholders, this will be the 1-indexed position of the parameter.
* @param mixed $value The value to bind to the parameter.
* @param int $type Explicit data type for the parameter using the {@link ParameterType}
* @param int $type Explicit data type for the parameter using the {@see ParameterType}
* constants.
*
* @return bool TRUE on success or FALSE on failure.
Expand All @@ -31,7 +31,7 @@ public function bindValue($param, $value, $type = ParameterType::STRING);

/**
* Binds a PHP variable to a corresponding named (not supported by mysqli driver, see comment below) or question
* mark placeholder in the SQL statement that was use to prepare the statement. Unlike {@link bindValue()},
* mark placeholder in the SQL statement that was use to prepare the statement. Unlike {@see bindValue()},
* the variable is bound as a reference and will only be evaluated at the time
* that PDOStatement->execute() is called.
*
Expand All @@ -47,7 +47,7 @@ public function bindValue($param, $value, $type = ParameterType::STRING);
* this will be a parameter name of the form :name. For a prepared statement using
* question mark placeholders, this will be the 1-indexed position of the parameter.
* @param mixed $variable Name of the PHP variable to bind to the SQL statement parameter.
* @param int $type Explicit data type for the parameter using the {@link ParameterType}
* @param int $type Explicit data type for the parameter using the {@see ParameterType}
* constants.
* @param int|null $length You must specify maxlength when using an OUT bind
* so that PHP allocates enough memory to hold the returned value.
Expand All @@ -62,7 +62,7 @@ public function bindParam($param, &$variable, $type = ParameterType::STRING, $le
* Executes a prepared statement
*
* If the prepared statement included parameter markers, you must either:
* call {@link bindParam()} to bind PHP variables to the parameter markers:
* call {@see bindParam()} to bind PHP variables to the parameter markers:
* bound variables pass their value as input and receive the output value,
* if any, of their associated parameter markers or pass an array of input-only
* parameter values.
Expand Down
Loading

0 comments on commit e4df1a5

Please sign in to comment.