apply PSR-12 rules

This commit is contained in:
Daniel Seifert 2022-07-18 23:59:49 +02:00
parent 95b95d1d8b
commit b22da1bd4a
Signed by: DanielS
GPG Key ID: 6A513E13AEE66170
6 changed files with 13 additions and 13 deletions

View File

@ -50,7 +50,7 @@ class RecipientsListTest extends ApiTestCase
$phoneUtil = PhoneNumberUtil::getInstance(); $phoneUtil = PhoneNumberUtil::getInstance();
$example = $phoneUtil->getExampleNumberForType($this->phoneCountryFixture, PhoneNumberType::MOBILE); $example = $phoneUtil->getExampleNumberForType($this->phoneCountryFixture, PhoneNumberType::MOBILE);
$this->phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL); $this->phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL);
} }
/** /**

View File

@ -124,7 +124,7 @@ abstract class AbstractRequest extends ApiTestCase
{ {
$phoneUtil = PhoneNumberUtil::getInstance(); $phoneUtil = PhoneNumberUtil::getInstance();
$example = $phoneUtil->getExampleNumberForType('DE', PhoneNumberType::MOBILE); $example = $phoneUtil->getExampleNumberForType('DE', PhoneNumberType::MOBILE);
$phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL); $phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL);
$recipient = new Recipient($phoneNumberFixture, 'DE'); $recipient = new Recipient($phoneNumberFixture, 'DE');
@ -157,7 +157,7 @@ abstract class AbstractRequest extends ApiTestCase
{ {
$phoneUtil = PhoneNumberUtil::getInstance(); $phoneUtil = PhoneNumberUtil::getInstance();
$example = $phoneUtil->getExampleNumberForType('DE', PhoneNumberType::MOBILE); $example = $phoneUtil->getExampleNumberForType('DE', PhoneNumberType::MOBILE);
$phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL); $phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL);
$recipient = new Recipient($phoneNumberFixture, 'DE'); $recipient = new Recipient($phoneNumberFixture, 'DE');

View File

@ -46,7 +46,7 @@ class RecipientTest extends ApiTestCase
$phoneUtil = PhoneNumberUtil::getInstance(); $phoneUtil = PhoneNumberUtil::getInstance();
$example = $phoneUtil->getExampleNumberForType($this->phoneCountryFixture, PhoneNumberType::MOBILE); $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); $this->recipient = new Recipient($this->phoneNumberFixture, $this->phoneCountryFixture);
} }
@ -155,7 +155,7 @@ class RecipientTest extends ApiTestCase
{ {
$phoneUtil = PhoneNumberUtil::getInstance(); $phoneUtil = PhoneNumberUtil::getInstance();
$example = $phoneUtil->getExampleNumberForType($this->phoneCountryFixture, PhoneNumberType::MOBILE); $example = $phoneUtil->getExampleNumberForType($this->phoneCountryFixture, PhoneNumberType::MOBILE);
$phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL); $phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL);
return [ return [
'empty number' => ['', 'DE', true, PhoneNumberType::MOBILE, InvalidArgumentException::class], 'empty number' => ['', 'DE', true, PhoneNumberType::MOBILE, InvalidArgumentException::class],

View File

@ -47,7 +47,7 @@ class SenderTest extends ApiTestCase
$phoneUtil = PhoneNumberUtil::getInstance(); $phoneUtil = PhoneNumberUtil::getInstance();
$example = $phoneUtil->getExampleNumberForType($this->phoneCountryFixture, PhoneNumberType::MOBILE); $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 */ /** @var Sender|MockObject sender */
$this->sender = new Sender($this->phoneNumberFixture, $this->phoneCountryFixture); $this->sender = new Sender($this->phoneNumberFixture, $this->phoneCountryFixture);
@ -107,7 +107,7 @@ class SenderTest extends ApiTestCase
{ {
$phoneUtil = PhoneNumberUtil::getInstance(); $phoneUtil = PhoneNumberUtil::getInstance();
$example = $phoneUtil->getExampleNumberForType($this->phoneCountryFixture, PhoneNumberType::MOBILE); $example = $phoneUtil->getExampleNumberForType($this->phoneCountryFixture, PhoneNumberType::MOBILE);
$this->phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL); $this->phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL);
return [ return [
'null number' => [null, $this->phoneCountryFixture, false], 'null number' => [null, $this->phoneCountryFixture, false],
@ -168,7 +168,7 @@ class SenderTest extends ApiTestCase
{ {
$phoneUtil = PhoneNumberUtil::getInstance(); $phoneUtil = PhoneNumberUtil::getInstance();
$example = $phoneUtil->getExampleNumberForType($this->phoneCountryFixture, PhoneNumberType::MOBILE); $example = $phoneUtil->getExampleNumberForType($this->phoneCountryFixture, PhoneNumberType::MOBILE);
$phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL); $phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL);
return [ return [
'empty number' => ['', 'DE', true, InvalidArgumentException::class], 'empty number' => ['', 'DE', true, InvalidArgumentException::class],

View File

@ -52,7 +52,7 @@ class ValueObjectTest extends ApiTestCase
{ {
$phoneUtil = PhoneNumberUtil::getInstance(); $phoneUtil = PhoneNumberUtil::getInstance();
$example = $phoneUtil->getExampleNumberForType('DE', PhoneNumberType::MOBILE); $example = $phoneUtil->getExampleNumberForType('DE', PhoneNumberType::MOBILE);
$phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL); $phoneNumberFixture = $phoneUtil->format($example, PhoneNumberFormat::NATIONAL);
$this->callMethod( $this->callMethod(
$this->value, $this->value,
@ -85,4 +85,4 @@ class ValueObjectTest extends ApiTestCase
[''] ['']
); );
} }
} }

View File

@ -53,7 +53,7 @@ class Recipient extends StringValueObject
$phoneUtil = $this->getPhoneNumberUtil(); $phoneUtil = $this->getPhoneNumberUtil();
$phoneNumber = $phoneUtil->parse($number, strtoupper($iso2CountryCode)); $phoneNumber = $phoneUtil->parse($number, strtoupper($iso2CountryCode));
$number = $phoneUtil->format( $phoneNumber, PhoneNumberFormat::E164 ); $number = $phoneUtil->format($phoneNumber, PhoneNumberFormat::E164);
if (false === $phoneUtil->isValidNumber($phoneNumber)) { if (false === $phoneUtil->isValidNumber($phoneNumber)) {
throw new RecipientException(ExceptionMessages::INVALID_RECIPIENT_PHONE); throw new RecipientException(ExceptionMessages::INVALID_RECIPIENT_PHONE);
@ -63,9 +63,9 @@ class Recipient extends StringValueObject
$this->allowedNumberTypes $this->allowedNumberTypes
) )
) { ) {
throw new RecipientException( ExceptionMessages::NOT_A_MOBILE_NUMBER); throw new RecipientException(ExceptionMessages::NOT_A_MOBILE_NUMBER);
} }
parent::__construct($number); parent::__construct($number);
$this->countryCode = $iso2CountryCode; $this->countryCode = $iso2CountryCode;
} }