apply PSR-12 rules
Cette révision appartient à :
Parent
95b95d1d8b
révision
b22da1bd4a
@ -50,7 +50,7 @@ class RecipientsListTest extends ApiTestCase
|
||||
|
||||
$phoneUtil = PhoneNumberUtil::getInstance();
|
||||
$example = $phoneUtil->getExampleNumberForType($this->phoneCountryFixture, PhoneNumberType::MOBILE);
|
||||
$this->phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL);
|
||||
$this->phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -124,7 +124,7 @@ abstract class AbstractRequest extends ApiTestCase
|
||||
{
|
||||
$phoneUtil = PhoneNumberUtil::getInstance();
|
||||
$example = $phoneUtil->getExampleNumberForType('DE', PhoneNumberType::MOBILE);
|
||||
$phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL);
|
||||
$phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL);
|
||||
|
||||
$recipient = new Recipient($phoneNumberFixture, 'DE');
|
||||
|
||||
@ -157,7 +157,7 @@ abstract class AbstractRequest extends ApiTestCase
|
||||
{
|
||||
$phoneUtil = PhoneNumberUtil::getInstance();
|
||||
$example = $phoneUtil->getExampleNumberForType('DE', PhoneNumberType::MOBILE);
|
||||
$phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL);
|
||||
$phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL);
|
||||
|
||||
$recipient = new Recipient($phoneNumberFixture, 'DE');
|
||||
|
||||
|
@ -46,7 +46,7 @@ class RecipientTest extends ApiTestCase
|
||||
|
||||
$phoneUtil = PhoneNumberUtil::getInstance();
|
||||
$example = $phoneUtil->getExampleNumberForType($this->phoneCountryFixture, PhoneNumberType::MOBILE);
|
||||
$this->phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL);
|
||||
$this->phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL);
|
||||
|
||||
$this->recipient = new Recipient($this->phoneNumberFixture, $this->phoneCountryFixture);
|
||||
}
|
||||
@ -155,7 +155,7 @@ class RecipientTest extends ApiTestCase
|
||||
{
|
||||
$phoneUtil = PhoneNumberUtil::getInstance();
|
||||
$example = $phoneUtil->getExampleNumberForType($this->phoneCountryFixture, PhoneNumberType::MOBILE);
|
||||
$phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL);
|
||||
$phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL);
|
||||
|
||||
return [
|
||||
'empty number' => ['', 'DE', true, PhoneNumberType::MOBILE, InvalidArgumentException::class],
|
||||
|
@ -47,7 +47,7 @@ class SenderTest extends ApiTestCase
|
||||
|
||||
$phoneUtil = PhoneNumberUtil::getInstance();
|
||||
$example = $phoneUtil->getExampleNumberForType($this->phoneCountryFixture, PhoneNumberType::MOBILE);
|
||||
$this->phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL);
|
||||
$this->phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL);
|
||||
|
||||
/** @var Sender|MockObject sender */
|
||||
$this->sender = new Sender($this->phoneNumberFixture, $this->phoneCountryFixture);
|
||||
@ -107,7 +107,7 @@ class SenderTest extends ApiTestCase
|
||||
{
|
||||
$phoneUtil = PhoneNumberUtil::getInstance();
|
||||
$example = $phoneUtil->getExampleNumberForType($this->phoneCountryFixture, PhoneNumberType::MOBILE);
|
||||
$this->phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL);
|
||||
$this->phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL);
|
||||
|
||||
return [
|
||||
'null number' => [null, $this->phoneCountryFixture, false],
|
||||
@ -168,7 +168,7 @@ class SenderTest extends ApiTestCase
|
||||
{
|
||||
$phoneUtil = PhoneNumberUtil::getInstance();
|
||||
$example = $phoneUtil->getExampleNumberForType($this->phoneCountryFixture, PhoneNumberType::MOBILE);
|
||||
$phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL);
|
||||
$phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL);
|
||||
|
||||
return [
|
||||
'empty number' => ['', 'DE', true, InvalidArgumentException::class],
|
||||
|
@ -52,7 +52,7 @@ class ValueObjectTest extends ApiTestCase
|
||||
{
|
||||
$phoneUtil = PhoneNumberUtil::getInstance();
|
||||
$example = $phoneUtil->getExampleNumberForType('DE', PhoneNumberType::MOBILE);
|
||||
$phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL);
|
||||
$phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL);
|
||||
|
||||
$this->callMethod(
|
||||
$this->value,
|
||||
@ -85,4 +85,4 @@ class ValueObjectTest extends ApiTestCase
|
||||
['']
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ class Recipient extends StringValueObject
|
||||
$phoneUtil = $this->getPhoneNumberUtil();
|
||||
|
||||
$phoneNumber = $phoneUtil->parse($number, strtoupper($iso2CountryCode));
|
||||
$number = $phoneUtil->format( $phoneNumber, PhoneNumberFormat::E164 );
|
||||
$number = $phoneUtil->format($phoneNumber, PhoneNumberFormat::E164);
|
||||
|
||||
if (false === $phoneUtil->isValidNumber($phoneNumber)) {
|
||||
throw new RecipientException(ExceptionMessages::INVALID_RECIPIENT_PHONE);
|
||||
@ -63,9 +63,9 @@ class Recipient extends StringValueObject
|
||||
$this->allowedNumberTypes
|
||||
)
|
||||
) {
|
||||
throw new RecipientException( ExceptionMessages::NOT_A_MOBILE_NUMBER);
|
||||
throw new RecipientException(ExceptionMessages::NOT_A_MOBILE_NUMBER);
|
||||
}
|
||||
|
||||
|
||||
parent::__construct($number);
|
||||
$this->countryCode = $iso2CountryCode;
|
||||
}
|
||||
|
Chargement…
Référencer dans un nouveau ticket
Block a user