format sender address as integer
This commit is contained in:
parent
81236bcf2c
commit
81b20fc979
@ -162,7 +162,7 @@ abstract class Request implements RequestInterface
|
||||
'priority' => $this->getPriority(),
|
||||
'recipientAddressList' => $this->getRecipientsList()->getRecipients(),
|
||||
'sendAsFlashSms' => $this->doSendAsFlashSms(),
|
||||
'senderAddress' => $this->getSenderAddress() ? $this->getSenderAddress()->get() : null,
|
||||
'senderAddress' => $this->getSenderAddress() ? $this->getSenderAddress()->getFormatted() : null,
|
||||
'senderAddressType' => $this->getSenderAddressType(),
|
||||
'test' => $this->getTestMode(),
|
||||
'validityPeriode' => $this->getValidityPeriode()
|
||||
|
@ -27,7 +27,7 @@ class Sender extends StringValueObject
|
||||
$phoneUtil = $this->getPhoneNumberUtil();
|
||||
|
||||
$phoneNumber = $phoneUtil->parse( $number, strtoupper($iso2CountryCode) );
|
||||
$number = $phoneUtil->format( $phoneNumber, PhoneNumberFormat::E164 );
|
||||
$number = ltrim($phoneUtil->format($phoneNumber, PhoneNumberFormat::E164), '+');
|
||||
|
||||
if (false === $phoneUtil->isValidNumber($phoneNumber)) {
|
||||
throw new RecipientException( ExceptionMessages::INVALID_SENDER );
|
||||
@ -43,4 +43,12 @@ class Sender extends StringValueObject
|
||||
{
|
||||
return PhoneNumberUtil::getInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getFormatted()
|
||||
{
|
||||
return (int) parent::getFormatted();
|
||||
}
|
||||
}
|
||||
|
@ -24,4 +24,9 @@ abstract class StringValueObject extends ValueObject
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
public function getFormatted()
|
||||
{
|
||||
return $this->get();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user