From bea2a312f07ff6d46b377b8c7bd117fd84b0c4ee Mon Sep 17 00:00:00 2001 From: Yann-BUTSCHER-EIRL Date: Thu, 6 Apr 2023 10:07:20 +0200 Subject: [PATCH] Ref #318: remove space in phone numbers --- src/FormDataObject/UpdatePeopleDataFDO.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/FormDataObject/UpdatePeopleDataFDO.php b/src/FormDataObject/UpdatePeopleDataFDO.php index f8d72a73..98c34a41 100644 --- a/src/FormDataObject/UpdatePeopleDataFDO.php +++ b/src/FormDataObject/UpdatePeopleDataFDO.php @@ -386,6 +386,7 @@ public function getHomePhoneNumber() */ public function setHomePhoneNumber(string $homePhoneNumber) { + $homePhoneNumber = str_replace(' ', '', $homePhoneNumber); if (!is_numeric($homePhoneNumber)) { throw new \InvalidArgumentException('The input given is not a phone number, only numbers allowed'); @@ -416,6 +417,8 @@ public function getCellPhoneNumber() */ public function setCellPhoneNumber(string $cellPhoneNumber) { + $cellPhoneNumber = str_replace(' ', '', $cellPhoneNumber); + if (!is_numeric($cellPhoneNumber)) { throw new \InvalidArgumentException('The input given is not a phone number, only numbers allowed'); @@ -446,6 +449,8 @@ public function getWorkPhoneNumber() */ public function setWorkPhoneNumber(string $workPhoneNumber) { + $workPhoneNumber = str_replace(' ', '', $workPhoneNumber); + if (!is_numeric($workPhoneNumber)) { throw new \InvalidArgumentException('The input given is not a phone number, only numbers allowed'); @@ -476,6 +481,8 @@ public function getWorkFaxNumber() */ public function setWorkFaxNumber(string $workFaxNumber) { + $workFaxNumber = str_replace(' ', '', $workFaxNumber); + if (!is_numeric($workFaxNumber)) { throw new \InvalidArgumentException('The input given is not a phone number, only numbers allowed');