From c7762dd6d27b2239aa0cd73d23ce71877c0cb939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 31 Mar 2022 12:51:53 +0200 Subject: [PATCH] fix trimming for email in person / thirdparty --- src/Bundle/ChillPersonBundle/Entity/Person.php | 8 +------- src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php | 3 +-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Entity/Person.php b/src/Bundle/ChillPersonBundle/Entity/Person.php index de7946ad3..ef522f068 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person.php @@ -1568,13 +1568,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI public function setEmail(?string $email): self { - if (null === $email) { - $email = ''; - } - - $email = trim($email); - - $this->email = $email; + $this->email = trim((string) $email); return $this; } diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php index 9c3d6fd7e..f060c4bfb 100644 --- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php @@ -762,8 +762,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface */ public function setEmail($email = null) { - $email = trim($email); - $this->email = $email; + $this->email = trim((string) $email); return $this; }