Skip to content

Commit

Permalink
[doctrineGH-4510] Trigger deprecation in AbstractPlatform::getReserve…
Browse files Browse the repository at this point in the history
…dKeywordsClass() implementations
  • Loading branch information
morozov committed Apr 1, 2021
1 parent 140bea1 commit a602f2b
Show file tree
Hide file tree
Showing 11 changed files with 88 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Platforms/AbstractPlatform.php
Expand Up @@ -3529,6 +3529,13 @@ protected function createReservedKeywordsList(): KeywordList
*/
protected function getReservedKeywordsClass()
{
Deprecation::triggerIfCalledFromOutside(
'doctrine/dbal',
'https://github.com/doctrine/dbal/issues/4510',
'AbstractPlatform::getReservedKeywordsClass() is deprecated,'
. ' use AbstractPlatform::createReservedKeywordsList() instead.'
);

throw Exception::notSupported(__METHOD__);
}

Expand Down
8 changes: 8 additions & 0 deletions src/Platforms/DB2Platform.php
Expand Up @@ -9,6 +9,7 @@
use Doctrine\DBAL\Schema\TableDiff;
use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use Doctrine\Deprecations\Deprecation;

use function array_merge;
use function count;
Expand Down Expand Up @@ -901,6 +902,13 @@ public function supportsSavepoints()
*/
protected function getReservedKeywordsClass()
{
Deprecation::triggerIfCalledFromOutside(
'doctrine/dbal',
'https://github.com/doctrine/dbal/issues/4510',
'DB2Platform::getReservedKeywordsClass() is deprecated,'
. ' use DB2Platform::createReservedKeywordsList() instead.'
);

return Keywords\DB2Keywords::class;
}

Expand Down
8 changes: 8 additions & 0 deletions src/Platforms/MariaDb1027Platform.php
Expand Up @@ -3,6 +3,7 @@
namespace Doctrine\DBAL\Platforms;

use Doctrine\DBAL\Types\Types;
use Doctrine\Deprecations\Deprecation;

/**
* Provides the behavior, features and SQL dialect of the MariaDB 10.2 (10.2.7 GA) database platform.
Expand All @@ -26,6 +27,13 @@ public function getJsonTypeDeclarationSQL(array $column): string
*/
protected function getReservedKeywordsClass(): string
{
Deprecation::triggerIfCalledFromOutside(
'doctrine/dbal',
'https://github.com/doctrine/dbal/issues/4510',
'MariaDb1027Platform::getReservedKeywordsClass() is deprecated,'
. ' use MariaDb1027Platform::createReservedKeywordsList() instead.'
);

return Keywords\MariaDb102Keywords::class;
}

Expand Down
8 changes: 8 additions & 0 deletions src/Platforms/MySQL57Platform.php
Expand Up @@ -6,6 +6,7 @@
use Doctrine\DBAL\Schema\TableDiff;
use Doctrine\DBAL\SQL\Parser;
use Doctrine\DBAL\Types\Types;
use Doctrine\Deprecations\Deprecation;

/**
* Provides the behavior, features and SQL dialect of the MySQL 5.7 (5.7.9 GA) database platform.
Expand Down Expand Up @@ -64,6 +65,13 @@ protected function getRenameIndexSQL($oldIndexName, Index $index, $tableName)
*/
protected function getReservedKeywordsClass()
{
Deprecation::triggerIfCalledFromOutside(
'doctrine/dbal',
'https://github.com/doctrine/dbal/issues/4510',
'MySQL57Platform::getReservedKeywordsClass() is deprecated,'
. ' use MySQL57Platform::createReservedKeywordsList() instead.'
);

return Keywords\MySQL57Keywords::class;
}

Expand Down
9 changes: 9 additions & 0 deletions src/Platforms/MySQL80Platform.php
Expand Up @@ -2,6 +2,8 @@

namespace Doctrine\DBAL\Platforms;

use Doctrine\Deprecations\Deprecation;

/**
* Provides the behavior, features and SQL dialect of the MySQL 8.0 (8.0 GA) database platform.
*/
Expand All @@ -14,6 +16,13 @@ class MySQL80Platform extends MySQL57Platform
*/
protected function getReservedKeywordsClass()
{
Deprecation::triggerIfCalledFromOutside(
'doctrine/dbal',
'https://github.com/doctrine/dbal/issues/4510',
'MySQL80Platform::getReservedKeywordsClass() is deprecated,'
. ' use MySQL80Platform::createReservedKeywordsList() instead.'
);

return Keywords\MySQL80Keywords::class;
}
}
8 changes: 8 additions & 0 deletions src/Platforms/MySQLPlatform.php
Expand Up @@ -11,6 +11,7 @@
use Doctrine\DBAL\TransactionIsolationLevel;
use Doctrine\DBAL\Types\BlobType;
use Doctrine\DBAL\Types\TextType;
use Doctrine\Deprecations\Deprecation;
use InvalidArgumentException;

use function array_diff_key;
Expand Down Expand Up @@ -1110,6 +1111,13 @@ public function getBinaryMaxLength()
*/
protected function getReservedKeywordsClass()
{
Deprecation::triggerIfCalledFromOutside(
'doctrine/dbal',
'https://github.com/doctrine/dbal/issues/4510',
'MySQLPlatform::getReservedKeywordsClass() is deprecated,'
. ' use MySQLPlatform::createReservedKeywordsList() instead.'
);

return Keywords\MySQLKeywords::class;
}

Expand Down
8 changes: 8 additions & 0 deletions src/Platforms/OraclePlatform.php
Expand Up @@ -11,6 +11,7 @@
use Doctrine\DBAL\Schema\TableDiff;
use Doctrine\DBAL\TransactionIsolationLevel;
use Doctrine\DBAL\Types\BinaryType;
use Doctrine\Deprecations\Deprecation;
use InvalidArgumentException;

use function array_merge;
Expand Down Expand Up @@ -1165,6 +1166,13 @@ public function releaseSavePoint($savepoint)
*/
protected function getReservedKeywordsClass()
{
Deprecation::triggerIfCalledFromOutside(
'doctrine/dbal',
'https://github.com/doctrine/dbal/issues/4510',
'OraclePlatform::getReservedKeywordsClass() is deprecated,'
. ' use OraclePlatform::createReservedKeywordsList() instead.'
);

return Keywords\OracleKeywords::class;
}

Expand Down
8 changes: 8 additions & 0 deletions src/Platforms/PostgreSQL100Platform.php
Expand Up @@ -5,6 +5,7 @@
namespace Doctrine\DBAL\Platforms;

use Doctrine\DBAL\Platforms\Keywords\PostgreSQL100Keywords;
use Doctrine\Deprecations\Deprecation;

/**
* Provides the behavior, features and SQL dialect of the PostgreSQL 10.0 database platform.
Expand All @@ -16,6 +17,13 @@ class PostgreSQL100Platform extends PostgreSQL94Platform
*/
protected function getReservedKeywordsClass(): string
{
Deprecation::triggerIfCalledFromOutside(
'doctrine/dbal',
'https://github.com/doctrine/dbal/issues/4510',
'PostgreSQL100Platform::getReservedKeywordsClass() is deprecated,'
. ' use PostgreSQL100Platform::createReservedKeywordsList() instead.'
);

return PostgreSQL100Keywords::class;
}

Expand Down
8 changes: 8 additions & 0 deletions src/Platforms/PostgreSQL94Platform.php
Expand Up @@ -14,6 +14,7 @@
use Doctrine\DBAL\Types\BlobType;
use Doctrine\DBAL\Types\IntegerType;
use Doctrine\DBAL\Types\Type;
use Doctrine\Deprecations\Deprecation;
use UnexpectedValueException;

use function array_diff;
Expand Down Expand Up @@ -1181,6 +1182,13 @@ public function hasNativeJsonType()
*/
protected function getReservedKeywordsClass()
{
Deprecation::triggerIfCalledFromOutside(
'doctrine/dbal',
'https://github.com/doctrine/dbal/issues/4510',
'PostgreSQL94Platform::getReservedKeywordsClass() is deprecated,'
. ' use PostgreSQL94Platform::createReservedKeywordsList() instead.'
);

return Keywords\PostgreSQL94Keywords::class;
}

Expand Down
8 changes: 8 additions & 0 deletions src/Platforms/SQLServer2012Platform.php
Expand Up @@ -12,6 +12,7 @@
use Doctrine\DBAL\Schema\Sequence;
use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Schema\TableDiff;
use Doctrine\Deprecations\Deprecation;
use InvalidArgumentException;

use function array_merge;
Expand Down Expand Up @@ -1561,6 +1562,13 @@ public function getForUpdateSQL()
*/
protected function getReservedKeywordsClass()
{
Deprecation::triggerIfCalledFromOutside(
'doctrine/dbal',
'https://github.com/doctrine/dbal/issues/4510',
'QLServer2012Platform::getReservedKeywordsClass() is deprecated,'
. ' use QLServer2012Platform::createReservedKeywordsList() instead.'
);

return Keywords\SQLServer2012Keywords::class;
}

Expand Down
8 changes: 8 additions & 0 deletions src/Platforms/SqlitePlatform.php
Expand Up @@ -11,6 +11,7 @@
use Doctrine\DBAL\Schema\TableDiff;
use Doctrine\DBAL\TransactionIsolationLevel;
use Doctrine\DBAL\Types;
use Doctrine\Deprecations\Deprecation;

use function array_merge;
use function array_unique;
Expand Down Expand Up @@ -689,6 +690,13 @@ protected function initializeDoctrineTypeMappings()
*/
protected function getReservedKeywordsClass()
{
Deprecation::triggerIfCalledFromOutside(
'doctrine/dbal',
'https://github.com/doctrine/dbal/issues/4510',
'SqlitePlatform::getReservedKeywordsClass() is deprecated,'
. ' use SqlitePlatform::createReservedKeywordsList() instead.'
);

return Keywords\SQLiteKeywords::class;
}

Expand Down

0 comments on commit a602f2b

Please sign in to comment.