src/Models/PhoneNumber.php
public function setNumber($number)
    {
        if (!is_numeric($number) && $number != null)
        {
            throw new InvalidArgumentException("Number is not numeric.");
        }
        $this->number = preg_replace('/\D/', '', $number);
    }
public function setNumber($number)
    {
        if (!is_numeric($number) && $number != null)
        {
            throw new InvalidArgumentException("Number is not numeric.");
        }
        $this->number = preg_replace('/\D/', '', $number);
    }
public function setNumber ( $ number ) { if ( ! is_numeric ( $ number ) && $ number != null ) { throw new InvalidArgumentException ( "Number is not numeric." ) ; } $ this -> number = preg_replace ( '/\D/' , '' , $ number ) ; }
Set the phone number.
@param $number
@return mixed
Set the phone number .