Skip to content

Commit

Permalink
[doctrineGH-3187] Convert binary column maxlength deprecation to Doct…
Browse files Browse the repository at this point in the history
…rine API.
  • Loading branch information
beberlei committed Mar 22, 2021
1 parent 59148f4 commit f4773bd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use Doctrine\DBAL\TransactionIsolationLevel;
use Doctrine\DBAL\Types;
use Doctrine\DBAL\Types\Type;
use Doctrine\Deprecations\Deprecation;
use InvalidArgumentException;
use UnexpectedValueException;

Expand Down Expand Up @@ -54,9 +55,6 @@
use function strpos;
use function strtolower;
use function strtoupper;
use function trigger_error;

use const E_USER_DEPRECATED;

/**
* Base class for all DatabasePlatforms. The DatabasePlatforms are the central
Expand Down Expand Up @@ -301,12 +299,14 @@ public function getBinaryTypeDeclarationSQL(array $column)

if ($column['length'] > $maxLength) {
if ($maxLength > 0) {
@trigger_error(sprintf(
Deprecation::trigger(
'doctrine/dbal',
'https://github.com/doctrine/dbal/issues/3187',
'Binary column length %d is greater than supported by the platform (%d).'
. ' Reduce the column length or use a BLOB column instead.',
$column['length'],
$maxLength
), E_USER_DEPRECATED);
);
}

return $this->getBlobTypeDeclarationSQL($column);
Expand Down

0 comments on commit f4773bd

Please sign in to comment.