From 6a736f1f340689a82165643a8022bc161f956dd7 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sun, 7 Mar 2021 01:06:51 +0100 Subject: [PATCH] [GH-3258] Trigger deprecation for Type::__toString(). --- lib/Doctrine/DBAL/Types/Type.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Doctrine/DBAL/Types/Type.php b/lib/Doctrine/DBAL/Types/Type.php index 9a642b5cd65..64e59fec068 100644 --- a/lib/Doctrine/DBAL/Types/Type.php +++ b/lib/Doctrine/DBAL/Types/Type.php @@ -315,6 +315,12 @@ static function (Type $type): string { */ public function __toString() { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/3258', + 'Type::__toString() is deprecated, use Type::getName() or get_class($type) instead.' + ); + $type = static::class; $position = strrpos($type, '\\');