diff --git a/src/Client.php b/src/Client.php index b458018..06b1c76 100644 --- a/src/Client.php +++ b/src/Client.php @@ -15,6 +15,7 @@ declare(strict_types=1); namespace D3\LinkmobilityClient; +use Assert\InvalidArgumentException; use D3\LinkmobilityClient\Request\RequestInterface; use D3\LinkmobilityClient\Url\Url; use D3\LinkmobilityClient\Url\UrlInterface; @@ -25,7 +26,6 @@ use GuzzleHttp\HandlerStack; use GuzzleHttp\MessageFormatter; use GuzzleHttp\Middleware; use GuzzleRetry\GuzzleRetryMiddleware; -use InvalidArgumentException; use Psr\Http\Message\ResponseInterface; class Client diff --git a/src/Request/Request.php b/src/Request/Request.php index 0b7fd94..c472d70 100644 --- a/src/Request/Request.php +++ b/src/Request/Request.php @@ -16,6 +16,7 @@ declare(strict_types=1); namespace D3\LinkmobilityClient\Request; use Assert\Assert; +use Assert\InvalidArgumentException; use D3\LinkmobilityClient\Client; use D3\LinkmobilityClient\Exceptions\ExceptionMessages; use D3\LinkmobilityClient\RecipientsList\RecipientsList; @@ -26,7 +27,6 @@ use D3\LinkmobilityClient\ValueObject\Sender; use D3\LinkmobilityClient\ValueObject\SmsMessageAbstract; use D3\LinkmobilityClient\ValueObject\SmsMessageInterface; use GuzzleHttp\RequestOptions; -use InvalidArgumentException; abstract class Request implements RequestInterface { diff --git a/src/Request/RequestInterface.php b/src/Request/RequestInterface.php index 90185f2..caefb10 100644 --- a/src/Request/RequestInterface.php +++ b/src/Request/RequestInterface.php @@ -15,10 +15,10 @@ declare(strict_types=1); namespace D3\LinkmobilityClient\Request; +use Assert\InvalidArgumentException; use D3\LinkmobilityClient\Client; use D3\LinkmobilityClient\RecipientsList\RecipientsListInterface; use D3\LinkmobilityClient\ValueObject\SmsMessageInterface; -use InvalidArgumentException; use Psr\Http\Message\ResponseInterface as PsrResponseInterface; use D3\LinkmobilityClient\Response\ResponseInterface as LMResponseInterface; diff --git a/src/SMS/BinaryRequest.php b/src/SMS/BinaryRequest.php index 6895224..8eefc2e 100644 --- a/src/SMS/BinaryRequest.php +++ b/src/SMS/BinaryRequest.php @@ -16,10 +16,10 @@ declare(strict_types=1); namespace D3\LinkmobilityClient\SMS; use Assert\Assert; +use Assert\InvalidArgumentException; use D3\LinkmobilityClient\Request\Request; use D3\LinkmobilityClient\Url\Url; use D3\LinkmobilityClient\ValueObject\SmsBinaryMessage; -use InvalidArgumentException; class BinaryRequest extends Request implements SmsRequestInterface { diff --git a/src/SMS/TextRequest.php b/src/SMS/TextRequest.php index b4ae0bf..2f2d041 100644 --- a/src/SMS/TextRequest.php +++ b/src/SMS/TextRequest.php @@ -16,10 +16,10 @@ declare(strict_types=1); namespace D3\LinkmobilityClient\SMS; use Assert\Assert; +use Assert\InvalidArgumentException; use D3\LinkmobilityClient\Request\Request; use D3\LinkmobilityClient\Url\Url; use D3\LinkmobilityClient\ValueObject\SmsTextMessage; -use InvalidArgumentException; class TextRequest extends Request implements SmsRequestInterface { diff --git a/src/ValueObject/Recipient.php b/src/ValueObject/Recipient.php index 2ec1115..865a48e 100644 --- a/src/ValueObject/Recipient.php +++ b/src/ValueObject/Recipient.php @@ -16,6 +16,7 @@ declare(strict_types=1); namespace D3\LinkmobilityClient\ValueObject; use Assert\Assert; +use Assert\InvalidArgumentException; use D3\LinkmobilityClient\Exceptions\ExceptionMessages; use D3\LinkmobilityClient\Exceptions\RecipientException; use libphonenumber\NumberParseException; @@ -44,6 +45,7 @@ class Recipient extends StringValueObject * * @throws NumberParseException * @throws RecipientException + * @throws InvalidArgumentException */ public function __construct(string $number, string $iso2CountryCode) { diff --git a/src/ValueObject/Sender.php b/src/ValueObject/Sender.php index 7b36c72..790f5af 100644 --- a/src/ValueObject/Sender.php +++ b/src/ValueObject/Sender.php @@ -16,6 +16,7 @@ declare(strict_types=1); namespace D3\LinkmobilityClient\ValueObject; use Assert\Assert; +use Assert\InvalidArgumentException; use D3\LinkmobilityClient\Exceptions\ExceptionMessages; use D3\LinkmobilityClient\Exceptions\NoSenderDefinedException; use D3\LinkmobilityClient\Exceptions\RecipientException; @@ -32,6 +33,7 @@ class Sender extends ValueObject * * @throws NumberParseException * @throws RecipientException + * @throws InvalidArgumentException */ public function __construct(string $number = null, string $iso2CountryCode = null) { diff --git a/src/ValueObject/SmsTextMessage.php b/src/ValueObject/SmsTextMessage.php index d5d99e1..e7d8ef4 100644 --- a/src/ValueObject/SmsTextMessage.php +++ b/src/ValueObject/SmsTextMessage.php @@ -15,7 +15,7 @@ declare(strict_types=1); namespace D3\LinkmobilityClient\ValueObject; -use InvalidArgumentException; +use Assert\InvalidArgumentException; class SmsTextMessage extends SmsMessageAbstract { diff --git a/src/ValueObject/ValueObject.php b/src/ValueObject/ValueObject.php index e537d1f..0f3b5d6 100644 --- a/src/ValueObject/ValueObject.php +++ b/src/ValueObject/ValueObject.php @@ -16,11 +16,16 @@ declare(strict_types=1); namespace D3\LinkmobilityClient\ValueObject; use Assert\Assert; +use Assert\InvalidArgumentException; abstract class ValueObject { protected $value; + /** + * @param string $number + * @throws InvalidArgumentException + */ public function __construct(string $number) { Assert::that($number)->notEmpty();