Skip to content

Commit d1d665b

Browse files
committed
Merge branch '4.3.x' into 5.0.x
2 parents 57fc66f + 5d6640a commit d1d665b

22 files changed

+180
-0
lines changed

UPGRADE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,24 @@ all drivers and middleware.
3333

3434
# Upgrade to 4.3
3535

36+
## Marked `Identifier` class as internal
37+
38+
In order to build SQL identifiers, use `AbstractPlatform::quoteSingleIdentifier()`.
39+
40+
## Deprecated Reserved Keyword Lists
41+
42+
The use of DBAL as the source for platform-specific reserved keyword lists has been deprecated. The following components
43+
have been deprecated:
44+
45+
1. The `KeywordList` class and all its subclasses.
46+
2. The methods `AbstractPlatform::createReservedKeywordsList()` and `::getReservedKeywordsList()`.
47+
3. The `AbstractPlatform::$_keywords` property.
48+
49+
Please refer to the official documentation provided by the respective database vendor for up-to-date information on
50+
reserved keywords.
51+
52+
Additionally, the `MySQL84Platform` class has been deprecated. Use the `MySQLPlatform` class instead.
53+
3654
## Deprecated relying on the current implementation of the database object name parser
3755

3856
The current object name parser implicitly quotes identifiers in the following cases:

psalm.xml.dist

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,24 @@
4242
<file name="src/Driver/OCI8/ConvertPositionalToNamedPlaceholders.php"/>
4343
</errorLevel>
4444
</ConflictingReferenceConstraint>
45+
<DeprecatedClass>
46+
<errorLevel type="suppress">
47+
<!--
48+
https://github.com/doctrine/dbal/pull/6607
49+
TODO: remove in 5.0.0
50+
-->
51+
<referencedClass name="Doctrine\DBAL\Platforms\Keywords\KeywordList" />
52+
<referencedClass name="Doctrine\DBAL\Platforms\Keywords\DB2Keywords" />
53+
<referencedClass name="Doctrine\DBAL\Platforms\Keywords\MariaDBKeywords" />
54+
<referencedClass name="Doctrine\DBAL\Platforms\Keywords\MySQLKeywords" />
55+
<referencedClass name="Doctrine\DBAL\Platforms\Keywords\MySQL84Keywords" />
56+
<referencedClass name="Doctrine\DBAL\Platforms\Keywords\PostgreSQLKeywords" />
57+
<referencedClass name="Doctrine\DBAL\Platforms\Keywords\OracleKeywords" />
58+
<referencedClass name="Doctrine\DBAL\Platforms\Keywords\SQLiteKeywords" />
59+
<referencedClass name="Doctrine\DBAL\Platforms\Keywords\SQLServerKeywords" />
60+
<referencedClass name="Doctrine\DBAL\Platforms\MySQL84Platform" />
61+
</errorLevel>
62+
</DeprecatedClass>
4563
<DeprecatedMethod>
4664
<errorLevel type="suppress">
4765
<!--
@@ -55,8 +73,24 @@
5573

5674
<!-- TODO for PHPUnit 11 -->
5775
<referencedMethod name="PHPUnit\Framework\TestCase::iniSet"/>
76+
77+
<!--
78+
https://github.com/doctrine/dbal/pull/6607
79+
TODO: remove in 5.0.0
80+
-->
81+
<referencedMethod name="Doctrine\DBAL\Platforms\AbstractPlatform::createReservedKeywordsList" />
82+
<referencedMethod name="Doctrine\DBAL\Platforms\AbstractPlatform::getReservedKeywordsList" />
5883
</errorLevel>
5984
</DeprecatedMethod>
85+
<DeprecatedProperty>
86+
<errorLevel type="suppress">
87+
<!--
88+
https://github.com/doctrine/dbal/pull/6607
89+
TODO: remove in 5.0.0
90+
-->
91+
<referencedProperty name="Doctrine\DBAL\Platforms\AbstractPlatform::$_keywords" />
92+
</errorLevel>
93+
</DeprecatedProperty>
6094
<DocblockTypeContradiction>
6195
<errorLevel type="suppress">
6296
<!--

src/Platforms/AbstractMySQLPlatform.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Doctrine\DBAL\Schema\TableDiff;
1717
use Doctrine\DBAL\TransactionIsolationLevel;
1818
use Doctrine\DBAL\Types\Types;
19+
use Doctrine\Deprecations\Deprecation;
1920

2021
use function array_map;
2122
use function array_merge;
@@ -756,8 +757,16 @@ protected function initializeDoctrineTypeMappings(): void
756757
];
757758
}
758759

760+
/** @deprecated */
759761
protected function createReservedKeywordsList(): KeywordList
760762
{
763+
Deprecation::triggerIfCalledFromOutside(
764+
'doctrine/dbal',
765+
'https://github.com/doctrine/dbal/pull/6607',
766+
'%s is deprecated.',
767+
__METHOD__,
768+
);
769+
761770
return new MySQLKeywords();
762771
}
763772

src/Platforms/AbstractPlatform.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
use Doctrine\DBAL\Types\Exception\TypeNotFound;
3838
use Doctrine\DBAL\Types\Type;
3939

40+
use Doctrine\Deprecations\Deprecation;
4041
use function addcslashes;
4142
use function array_map;
4243
use function array_merge;
@@ -75,6 +76,8 @@ abstract class AbstractPlatform
7576

7677
/**
7778
* Holds the KeywordList instance for the current platform.
79+
*
80+
* @deprecated
7881
*/
7982
protected ?KeywordList $_keywords = null;
8083

@@ -2124,15 +2127,26 @@ public function rollbackSavePoint(string $savepoint): string
21242127

21252128
/**
21262129
* Returns the keyword list instance of this platform.
2130+
*
2131+
* @deprecated
21272132
*/
21282133
final public function getReservedKeywordsList(): KeywordList
21292134
{
2135+
Deprecation::triggerIfCalledFromOutside(
2136+
'doctrine/dbal',
2137+
'https://github.com/doctrine/dbal/pull/6607',
2138+
'%s is deprecated.',
2139+
__METHOD__,
2140+
);
2141+
21302142
// Store the instance so it doesn't need to be generated on every request.
21312143
return $this->_keywords ??= $this->createReservedKeywordsList();
21322144
}
21332145

21342146
/**
21352147
* Creates an instance of the reserved keyword list of this platform.
2148+
*
2149+
* @deprecated
21362150
*/
21372151
abstract protected function createReservedKeywordsList(): KeywordList;
21382152

src/Platforms/DB2Platform.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Doctrine\DBAL\TransactionIsolationLevel;
1919
use Doctrine\DBAL\Types\DateTimeType;
2020
use Doctrine\DBAL\Types\Types;
21+
use Doctrine\Deprecations\Deprecation;
2122

2223
use function array_merge;
2324
use function count;
@@ -591,8 +592,16 @@ public function supportsSavepoints(): bool
591592
return false;
592593
}
593594

595+
/** @deprecated */
594596
protected function createReservedKeywordsList(): KeywordList
595597
{
598+
Deprecation::triggerIfCalledFromOutside(
599+
'doctrine/dbal',
600+
'https://github.com/doctrine/dbal/pull/6607',
601+
'%s is deprecated.',
602+
__METHOD__,
603+
);
604+
596605
return new DB2Keywords();
597606
}
598607

src/Platforms/Keywords/DB2Keywords.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
/**
88
* DB2 Keywords.
9+
*
10+
* @deprecated
911
*/
1012
class DB2Keywords extends KeywordList
1113
{

src/Platforms/Keywords/KeywordList.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,32 @@
44

55
namespace Doctrine\DBAL\Platforms\Keywords;
66

7+
use Doctrine\Deprecations\Deprecation;
8+
79
use function array_flip;
810
use function array_map;
911
use function strtoupper;
1012

1113
/**
1214
* Abstract interface for a SQL reserved keyword dictionary.
15+
*
16+
* @deprecated
1317
*/
1418
abstract class KeywordList
1519
{
1620
/** @var string[]|null */
1721
private ?array $keywords = null;
1822

23+
public function __construct()
24+
{
25+
Deprecation::triggerIfCalledFromOutside(
26+
'doctrine/dbal',
27+
'https://github.com/doctrine/dbal/pull/6607',
28+
'%s is deprecated.',
29+
static::class,
30+
);
31+
}
32+
1933
/**
2034
* Checks if the given word is a keyword of this dialect/vendor platform.
2135
*/

src/Platforms/Keywords/MariaDBKeywords.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Doctrine\DBAL\Platforms\Keywords;
66

7+
/** @deprecated */
78
class MariaDBKeywords extends KeywordList
89
{
910
/**

src/Platforms/Keywords/MySQL84Keywords.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
/**
1111
* MySQL 8.4 reserved keywords list.
12+
*
13+
* @deprecated
1214
*/
1315
class MySQL84Keywords extends MySQLKeywords
1416
{

src/Platforms/Keywords/MySQLKeywords.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
/**
88
* MySQL Keywordlist.
9+
*
10+
* @deprecated
911
*/
1012
class MySQLKeywords extends KeywordList
1113
{

0 commit comments

Comments
 (0)