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; }