Skip to content

Commit

Permalink
Ref #318: remove space in phone numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
Yann-BUTSCHER-EIRL committed Apr 6, 2023
1 parent e4e9737 commit bea2a31
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/FormDataObject/UpdatePeopleDataFDO.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit bea2a31

Please sign in to comment.