From 36b370f7f774991c639688e56545d75f4d360aeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sun, 13 Jan 2019 14:05:34 +0100 Subject: [PATCH] Add missing conditional statement We do not want the deprecation to be triggered when this is autoloaded from the new class for BC reasons. --- .../Validator/Constraints/InlineConstraint.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/CoreBundle/Validator/Constraints/InlineConstraint.php b/src/CoreBundle/Validator/Constraints/InlineConstraint.php index 8b332886..f8579250 100755 --- a/src/CoreBundle/Validator/Constraints/InlineConstraint.php +++ b/src/CoreBundle/Validator/Constraints/InlineConstraint.php @@ -13,11 +13,13 @@ namespace Sonata\CoreBundle\Validator\Constraints; -@trigger_error( - 'The '.__NAMESPACE__.'\InlineConstraint class is deprecated since version 3.x and will be removed in 4.0.' - .' Use Sonata\Form\Validator\Constraint\InlineConstraint instead.', - E_USER_DEPRECATED -); +if (!class_exists(Sonata\Form\Validator\Constraints\InlineConstraint::class, false)) { + @trigger_error( + 'The '.__NAMESPACE__.'\InlineConstraint class is deprecated since version 3.x and will be removed in 4.0.' + .' Use Sonata\Form\Validator\Constraint\InlineConstraint instead.', + E_USER_DEPRECATED + ); +} class_alias( \Sonata\Form\Validator\Constraints\InlineConstraint::class,