Skip to content

Commit

Permalink
[doctrineGH-4132] Add deprecation for AbstractPlatform::fixSchemaElem…
Browse files Browse the repository at this point in the history
…entName
  • Loading branch information
beberlei committed Mar 7, 2021
1 parent debd8cd commit c796d3a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -3511,6 +3511,12 @@ public function getSQLResultCasing($column)
*/
public function fixSchemaElementName($schemaElementName)
{
Deprecation::trigger(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/4132',
'AbstractPlatform::fixSchemaElementName is deprecated with no replacement and removed in DBAL 3.0'
);

return $schemaElementName;
}

Expand Down
7 changes: 7 additions & 0 deletions lib/Doctrine/DBAL/Platforms/OraclePlatform.php
Original file line number Diff line number Diff line change
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 @@ -1104,6 +1105,12 @@ public function getTimeFormatString()
*/
public function fixSchemaElementName($schemaElementName)
{
Deprecation::trigger(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/4132',
'AbstractPlatform::fixSchemaElementName is deprecated with no replacement and removed in DBAL 3.0'
);

if (strlen($schemaElementName) > 30) {
// Trim it
return substr($schemaElementName, 0, 30);
Expand Down
7 changes: 7 additions & 0 deletions lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Schema\TableDiff;
use Doctrine\DBAL\TransactionIsolationLevel;
use Doctrine\Deprecations\Deprecation;
use InvalidArgumentException;

use function array_merge;
Expand Down Expand Up @@ -72,6 +73,12 @@ public function appendLockHint($fromClause, $lockMode)
*/
public function fixSchemaElementName($schemaElementName)
{
Deprecation::trigger(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/4132',
'AbstractPlatform::fixSchemaElementName is deprecated with no replacement and removed in DBAL 3.0'
);

$maxIdentifierLength = $this->getMaxIdentifierLength();

if (strlen($schemaElementName) > $maxIdentifierLength) {
Expand Down

0 comments on commit c796d3a

Please sign in to comment.