From f4773bda73e71d64618f00855b6066a90a967a90 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sat, 6 Mar 2021 18:43:58 +0100 Subject: [PATCH] [GH-3187] Convert binary column maxlength deprecation to Doctrine API. --- lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php b/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php index 8a56c91aac6..4e7d0a61eb0 100644 --- a/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php @@ -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; @@ -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 @@ -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);