From 473072748495b046fd61be5d4d92ec860e89925e Mon Sep 17 00:00:00 2001 From: webeweb Date: Mon, 29 Apr 2024 10:19:49 +0200 Subject: [PATCH] Update dependencies --- composer.json | 3 +- src/Model/SentSmsMessage.php | 2 +- src/Model/SmsReply.php | 6 ++-- src/Model/SmsReplyCallback.php | 2 +- src/Provider/AbstractProvider.php | 10 +++--- src/Provider/ApiProvider.php | 34 +++++++++---------- src/Request/AddingContactRequest.php | 2 +- src/Request/CreatingSubAccountRequest.php | 6 ++-- src/Request/SendingSmsMessageRequest.php | 2 +- src/Request/SendingTextToSpeechSmsRequest.php | 2 +- src/Request/TransferringCreditsRequest.php | 2 +- src/Response/AbstractResponse.php | 6 ++-- src/Response/CreatingApiKeyResponse.php | 2 +- src/Serializer/RequestSerializer.php | 2 +- src/Serializer/ResponseDeserializer.php | 2 +- 15 files changed, 42 insertions(+), 41 deletions(-) diff --git a/composer.json b/composer.json index b5f5a4f..b0b80d1 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,8 @@ "ext-json": "*", "guzzlehttp/guzzle": "^6.0|^7.0", "psr/log": "^1.0|^2.0|^3.0", - "webeweb/core-library": "^8.0" + "symfony/yaml": "^4.4|^5.0|^6.0", + "webeweb/core-library": "^9.0" }, "require-dev": { "phpstan/extension-installer": "^1.1", diff --git a/src/Model/SentSmsMessage.php b/src/Model/SentSmsMessage.php index 3a495b1..beca097 100644 --- a/src/Model/SentSmsMessage.php +++ b/src/Model/SentSmsMessage.php @@ -14,10 +14,10 @@ namespace WBW\Library\SmsMode\Model; use DateTime; +use WBW\Library\Common\Traits\Strings\StringMessageTrait; use WBW\Library\SmsMode\Response\AbstractResponse; use WBW\Library\SmsMode\Traits\Strings\StringNumeroTrait; use WBW\Library\SmsMode\Traits\Strings\StringSmsIDTrait; -use WBW\Library\Traits\Strings\StringMessageTrait; /** * Sent SMS message. diff --git a/src/Model/SmsReply.php b/src/Model/SmsReply.php index 6af716e..4ff0a6b 100644 --- a/src/Model/SmsReply.php +++ b/src/Model/SmsReply.php @@ -14,11 +14,11 @@ namespace WBW\Library\SmsMode\Model; use DateTime; +use WBW\Library\Common\Traits\Strings\StringFromTrait; +use WBW\Library\Common\Traits\Strings\StringTextTrait; +use WBW\Library\Common\Traits\Strings\StringToTrait; use WBW\Library\SmsMode\Response\AbstractResponse; use WBW\Library\SmsMode\Traits\Strings\StringResponseIDTrait; -use WBW\Library\Traits\Strings\StringFromTrait; -use WBW\Library\Traits\Strings\StringTextTrait; -use WBW\Library\Traits\Strings\StringToTrait; /** * SMS reply. diff --git a/src/Model/SmsReplyCallback.php b/src/Model/SmsReplyCallback.php index e2245f1..bc3d7bc 100644 --- a/src/Model/SmsReplyCallback.php +++ b/src/Model/SmsReplyCallback.php @@ -13,6 +13,7 @@ namespace WBW\Library\SmsMode\Model; +use WBW\Library\Common\Traits\Strings\StringMessageTrait; use WBW\Library\SmsMode\Api\SmsReplyCallbackInterface; use WBW\Library\SmsMode\Response\AbstractResponse; use WBW\Library\SmsMode\Traits\DateTimes\DateTimeDateReceptionTrait; @@ -21,7 +22,6 @@ use WBW\Library\SmsMode\Traits\Strings\StringRefClientTrait; use WBW\Library\SmsMode\Traits\Strings\StringResponseIDTrait; use WBW\Library\SmsMode\Traits\Strings\StringSmsIDTrait; -use WBW\Library\Traits\Strings\StringMessageTrait; /** * SMS reply callback. diff --git a/src/Provider/AbstractProvider.php b/src/Provider/AbstractProvider.php index 810ff1c..a5d16a4 100644 --- a/src/Provider/AbstractProvider.php +++ b/src/Provider/AbstractProvider.php @@ -17,12 +17,12 @@ use InvalidArgumentException; use Psr\Log\LoggerInterface; use Throwable; -use WBW\Library\Provider\AbstractProvider as BaseProvider; -use WBW\Library\Provider\Exception\ApiException; +use WBW\Library\Common\Helper\ArrayHelper; +use WBW\Library\Common\Provider\AbstractProvider as BaseProvider; +use WBW\Library\Common\Provider\ProviderException; use WBW\Library\SmsMode\Model\Authentication; use WBW\Library\SmsMode\Request\AbstractRequest; use WBW\Library\SmsMode\Serializer\RequestSerializer; -use WBW\Library\Types\Helper\ArrayHelper; /** * Abstract provider. @@ -93,7 +93,7 @@ private function buildConfiguration(): array { * @param mixed[] $postData The post data. * @return string Returns the raw response. * @throws InvalidArgumentException Throws an invalid argument exception if a parameter is missing. - * @throws ApiException Throws an API exception if an error occurs. + * @throws ProviderException Throws a provider exception if an error occurs. */ protected function callApi(AbstractRequest $request, array $queryData, array $postData = []): string { @@ -122,7 +122,7 @@ protected function callApi(AbstractRequest $request, array $queryData, array $po throw $ex; } catch (Throwable $ex) { - throw new ApiException("Call sMsmode API failed", 500, $ex); + throw new ProviderException("Call sMsmode API failed", 500, $ex); } } diff --git a/src/Provider/ApiProvider.php b/src/Provider/ApiProvider.php index e12e070..c7daa70 100644 --- a/src/Provider/ApiProvider.php +++ b/src/Provider/ApiProvider.php @@ -15,7 +15,7 @@ use GuzzleHttp\Exception\ClientException; use InvalidArgumentException; -use WBW\Library\Provider\Exception\ApiException; +use WBW\Library\Common\Provider\ProviderException; use WBW\Library\SmsMode\Request\AccountBalanceRequest; use WBW\Library\SmsMode\Request\AddingContactRequest; use WBW\Library\SmsMode\Request\CheckingSmsMessageStatusRequest; @@ -62,7 +62,7 @@ class ApiProvider extends AbstractProvider { * @param AccountBalanceRequest $request The account balance request. * @return AccountBalanceResponse Returns the account balance response. * @throws InvalidArgumentException Throws an invalid argument exception if a parameter is missing. - * @throws ApiException Throws an API exception if an error occurs. + * @throws ProviderException Throws a provider exception if an error occurs. */ public function accountBalance(AccountBalanceRequest $request): AccountBalanceResponse { @@ -79,7 +79,7 @@ public function accountBalance(AccountBalanceRequest $request): AccountBalanceRe * @param AddingContactRequest $request The adding contact request. * @return AddingContactResponse Returns the adding contact response. * @throws InvalidArgumentException Throws an invalid argument exception if a parameter is missing. - * @throws ApiException Throws an API exception if an error occurs. + * @throws ProviderException Throws a provider exception if an error occurs. */ public function addingContact(AddingContactRequest $request): AddingContactResponse { @@ -96,7 +96,7 @@ public function addingContact(AddingContactRequest $request): AddingContactRespo * @param CheckingSmsMessageStatusRequest $request The checking SMS message status request. * @return CheckingSmsMessageStatusResponse Returns the checking SMS message status response. * @throws InvalidArgumentException Throws an invalid argument exception if a parameter is missing. - * @throws ApiException Throws an API exception if an error occurs. + * @throws ProviderException Throws a provider exception if an error occurs. */ public function checkingSmsMessageStatus(CheckingSmsMessageStatusRequest $request): CheckingSmsMessageStatusResponse { @@ -113,7 +113,7 @@ public function checkingSmsMessageStatus(CheckingSmsMessageStatusRequest $reques * @param CreatingApiKeyRequest $request The creating API key request. * @return CreatingApiKeyResponse Returns the creating API key response. * @throws InvalidArgumentException Throws an invalid argument exception if a parameter is missing. - * @throws ApiException Throws an API exception if an error occurs. + * @throws ProviderException Throws a provider exception if an error occurs. */ public function creatingApiKey(CreatingApiKeyRequest $request): CreatingApiKeyResponse { @@ -122,7 +122,7 @@ public function creatingApiKey(CreatingApiKeyRequest $request): CreatingApiKeyRe try { $rawResponse = $this->callApi($request, $queryData); - } catch (ApiException $ex) { + } catch (ProviderException $ex) { $previous = $ex->getPrevious(); if (false === ($previous instanceof ClientException)) { @@ -141,7 +141,7 @@ public function creatingApiKey(CreatingApiKeyRequest $request): CreatingApiKeyRe * @param CreatingSubAccountRequest $request The creating sub-account request. * @return CreatingSubAccountResponse Returns the creating sub-account response. * @throws InvalidArgumentException Throws an invalid argument exception if a parameter is missing. - * @throws ApiException Throws an API exception if an error occurs. + * @throws ProviderException Throws a provider exception if an error occurs. */ public function creatingSubAccount(CreatingSubAccountRequest $request): CreatingSubAccountResponse { @@ -158,7 +158,7 @@ public function creatingSubAccount(CreatingSubAccountRequest $request): Creating * @param DeletingSmsRequest $request The deleting SMS request. * @return DeletingSmsResponse Returns the delivery SMS message response. * @throws InvalidArgumentException Throws an invalid argument exception if a parameter is missing. - * @throws ApiException Throws an API exception if an error occurs. + * @throws ProviderException Throws a provider exception if an error occurs. */ public function deletingSms(DeletingSmsRequest $request): DeletingSmsResponse { @@ -175,7 +175,7 @@ public function deletingSms(DeletingSmsRequest $request): DeletingSmsResponse { * @param DeletingSubAccountRequest $request The deleting sub-account request. * @return DeletingSubAccountResponse Returns the delivery sub-account response. * @throws InvalidArgumentException Throws an invalid argument exception if a parameter is missing. - * @throws ApiException Throws an API exception if an error occurs. + * @throws ProviderException Throws a provider exception if an error occurs. */ public function deletingSubAccount(DeletingSubAccountRequest $request): DeletingSubAccountResponse { @@ -192,7 +192,7 @@ public function deletingSubAccount(DeletingSubAccountRequest $request): Deleting * @param DeliveryReportRequest $request The delivery report request. * @return DeliveryReportResponse Returns the delivery report response. * @throws InvalidArgumentException Throws an invalid argument exception if a parameter is missing. - * @throws ApiException Throws an API exception if an error occurs. + * @throws ProviderException Throws a provider exception if an error occurs. */ public function deliveryReport(DeliveryReportRequest $request): DeliveryReportResponse { @@ -209,7 +209,7 @@ public function deliveryReport(DeliveryReportRequest $request): DeliveryReportRe * @param RetrievingSmsReplyRequest $request The retrieving SMS reply request. * @return RetrievingSmsReplyResponse Returns the retrieving SMS reply response. * @throws InvalidArgumentException Throws an invalid argument exception if a parameter is missing. - * @throws ApiException Throws an API exception if an error occurs. + * @throws ProviderException Throws a provider exception if an error occurs. */ public function retrievingSmsReply(RetrievingSmsReplyRequest $request): RetrievingSmsReplyResponse { @@ -226,7 +226,7 @@ public function retrievingSmsReply(RetrievingSmsReplyRequest $request): Retrievi * @param SendingSmsBatchRequest $request The sending SMS batch request. * @return SendingSmsBatchResponse Returns the sending SMS message response. * @throws InvalidArgumentException Throws an invalid argument exception if a parameter is missing. - * @throws ApiException Throws an API exception if an error occurs. + * @throws ProviderException Throws a provider exception if an error occurs. */ public function sendingSmsBatch(SendingSmsBatchRequest $request): SendingSmsBatchResponse { @@ -254,7 +254,7 @@ public function sendingSmsBatch(SendingSmsBatchRequest $request): SendingSmsBatc * @param SendingSmsMessageRequest $request The sending SMS message request. * @return SendingSmsMessageResponse Returns the sending SMS message response. * @throws InvalidArgumentException Throws an invalid argument exception if a parameter is missing. - * @throws ApiException Throws an API exception if an error occurs. + * @throws ProviderException Throws a provider exception if an error occurs. */ public function sendingSmsMessage(SendingSmsMessageRequest $request): SendingSmsMessageResponse { @@ -277,7 +277,7 @@ public function sendingSmsMessage(SendingSmsMessageRequest $request): SendingSms * @param SendingTextToSpeechSmsRequest $request The sending text-to-speech SMS request. * @return SendingTextToSpeechSmsResponse Returns the sending text-to-speech response. * @throws InvalidArgumentException Throws an invalid argument exception if a parameter is missing. - * @throws ApiException Throws an API exception if an error occurs. + * @throws ProviderException Throws a provider exception if an error occurs. */ public function sendingTextToSpeechSms(SendingTextToSpeechSmsRequest $request): SendingTextToSpeechSmsResponse { @@ -300,7 +300,7 @@ public function sendingTextToSpeechSms(SendingTextToSpeechSmsRequest $request): * @param SendingUnicodeSmsRequest $request The sending unicode SMS request. * @return SendingUnicodeSmsResponse Returns the sending unicode response. * @throws InvalidArgumentException Throws an invalid argument exception if a parameter is missing. - * @throws ApiException Throws an API exception if an error occurs. + * @throws ProviderException Throws a provider exception if an error occurs. */ public function sendingUnicodeSms(SendingUnicodeSmsRequest $request): SendingUnicodeSmsResponse { @@ -323,7 +323,7 @@ public function sendingUnicodeSms(SendingUnicodeSmsRequest $request): SendingUni * @param SentSmsMessageListRequest $request The sent SMS message list request. * @return SentSmsMessageListResponse Returns the sent SMS message list response. * @throws InvalidArgumentException Throws an invalid argument exception if a parameter is missing. - * @throws ApiException Throws an API exception if an error occurs. + * @throws ProviderException Throws a provider exception if an error occurs. */ public function sentSmsMessageList(SentSmsMessageListRequest $request): SentSmsMessageListResponse { @@ -340,7 +340,7 @@ public function sentSmsMessageList(SentSmsMessageListRequest $request): SentSmsM * @param TransferringCreditsRequest $request The transferring credits request. * @return TransferringCreditsResponse Returns the transferring credits response. * @throws InvalidArgumentException Throws an invalid argument exception if a parameter is missing. - * @throws ApiException Throws an API exception if an error occurs. + * @throws ProviderException Throws a provider exception if an error occurs. */ public function transferringCredits(TransferringCreditsRequest $request): TransferringCreditsResponse { diff --git a/src/Request/AddingContactRequest.php b/src/Request/AddingContactRequest.php index 314855e..7cb6fa4 100644 --- a/src/Request/AddingContactRequest.php +++ b/src/Request/AddingContactRequest.php @@ -14,12 +14,12 @@ namespace WBW\Library\SmsMode\Request; use UnexpectedValueException; +use WBW\Library\Common\Traits\DateTimes\DateTimeDateTrait; use WBW\Library\SmsMode\Serializer\NumeroSerializer; use WBW\Library\SmsMode\Traits\Strings\StringMobileTrait; use WBW\Library\SmsMode\Traits\Strings\StringNomTrait; use WBW\Library\SmsMode\Traits\Strings\StringPrenomTrait; use WBW\Library\SmsMode\Traits\Strings\StringSocieteTrait; -use WBW\Library\Traits\DateTimes\DateTimeDateTrait; /** * Adding contact request. diff --git a/src/Request/CreatingSubAccountRequest.php b/src/Request/CreatingSubAccountRequest.php index 2e54559..2ea9835 100644 --- a/src/Request/CreatingSubAccountRequest.php +++ b/src/Request/CreatingSubAccountRequest.php @@ -14,14 +14,14 @@ namespace WBW\Library\SmsMode\Request; use UnexpectedValueException; +use WBW\Library\Common\Traits\DateTimes\DateTimeDateTrait; +use WBW\Library\Common\Traits\Strings\StringEmailTrait; +use WBW\Library\Common\Traits\Strings\StringReferenceTrait; use WBW\Library\SmsMode\Serializer\NumeroSerializer; use WBW\Library\SmsMode\Traits\Strings\StringMobileTrait; use WBW\Library\SmsMode\Traits\Strings\StringNomTrait; use WBW\Library\SmsMode\Traits\Strings\StringPrenomTrait; use WBW\Library\SmsMode\Traits\Strings\StringSocieteTrait; -use WBW\Library\Traits\DateTimes\DateTimeDateTrait; -use WBW\Library\Traits\Strings\StringEmailTrait; -use WBW\Library\Traits\Strings\StringReferenceTrait; /** * Creating sub-account request. diff --git a/src/Request/SendingSmsMessageRequest.php b/src/Request/SendingSmsMessageRequest.php index c70f5d0..183a8f6 100644 --- a/src/Request/SendingSmsMessageRequest.php +++ b/src/Request/SendingSmsMessageRequest.php @@ -15,6 +15,7 @@ use InvalidArgumentException; use UnexpectedValueException; +use WBW\Library\Common\Traits\Strings\StringMessageTrait; use WBW\Library\SmsMode\Api\SendingSmsMessageInterface; use WBW\Library\SmsMode\Serializer\NumeroSerializer; use WBW\Library\SmsMode\Traits\DateTimes\DateTimeDateEnvoiTrait; @@ -23,7 +24,6 @@ use WBW\Library\SmsMode\Traits\Strings\StringEmetteurTrait; use WBW\Library\SmsMode\Traits\Strings\StringNotificationUrlTrait; use WBW\Library\SmsMode\Traits\Strings\StringRefClientTrait; -use WBW\Library\Traits\Strings\StringMessageTrait; /** * Sending SMS message request. diff --git a/src/Request/SendingTextToSpeechSmsRequest.php b/src/Request/SendingTextToSpeechSmsRequest.php index 0db0d38..4229c6f 100644 --- a/src/Request/SendingTextToSpeechSmsRequest.php +++ b/src/Request/SendingTextToSpeechSmsRequest.php @@ -15,10 +15,10 @@ use InvalidArgumentException; use UnexpectedValueException; +use WBW\Library\Common\Traits\Strings\StringMessageTrait; use WBW\Library\SmsMode\Api\SendingTextToSpeechSmsInterface; use WBW\Library\SmsMode\Serializer\NumeroSerializer; use WBW\Library\SmsMode\Traits\DateTimes\DateTimeDateEnvoiTrait; -use WBW\Library\Traits\Strings\StringMessageTrait; /** * Sending text-to-speech SMS request. diff --git a/src/Request/TransferringCreditsRequest.php b/src/Request/TransferringCreditsRequest.php index d16cb92..d481bc5 100644 --- a/src/Request/TransferringCreditsRequest.php +++ b/src/Request/TransferringCreditsRequest.php @@ -13,7 +13,7 @@ namespace WBW\Library\SmsMode\Request; -use WBW\Library\Traits\Strings\StringReferenceTrait; +use WBW\Library\Common\Traits\Strings\StringReferenceTrait; /** * Transferring credits request. diff --git a/src/Response/AbstractResponse.php b/src/Response/AbstractResponse.php index 4d74c9e..6873ebb 100644 --- a/src/Response/AbstractResponse.php +++ b/src/Response/AbstractResponse.php @@ -13,10 +13,10 @@ namespace WBW\Library\SmsMode\Response; -use WBW\Library\Provider\Response\AbstractResponse as BaseResponse; +use WBW\Library\Common\Provider\AbstractResponse as BaseResponse; +use WBW\Library\Common\Traits\Integers\IntegerCodeTrait; +use WBW\Library\Common\Traits\Strings\StringDescriptionTrait; use WBW\Library\SmsMode\Api\ResponseInterface; -use WBW\Library\Traits\Integers\IntegerCodeTrait; -use WBW\Library\Traits\Strings\StringDescriptionTrait; /** * Abstract response. diff --git a/src/Response/CreatingApiKeyResponse.php b/src/Response/CreatingApiKeyResponse.php index 6d67230..6d3ce44 100644 --- a/src/Response/CreatingApiKeyResponse.php +++ b/src/Response/CreatingApiKeyResponse.php @@ -14,8 +14,8 @@ namespace WBW\Library\SmsMode\Response; use DateTime; +use WBW\Library\Common\Traits\Strings\StringIdTrait; use WBW\Library\SmsMode\Traits\Strings\StringAccessTokenTrait; -use WBW\Library\Traits\Strings\StringIdTrait; /** * Creating API key response. diff --git a/src/Serializer/RequestSerializer.php b/src/Serializer/RequestSerializer.php index 13b1e99..35d229a 100644 --- a/src/Serializer/RequestSerializer.php +++ b/src/Serializer/RequestSerializer.php @@ -16,8 +16,8 @@ use DateTime; use InvalidArgumentException; use Symfony\Component\Yaml\Yaml; +use WBW\Library\Common\Helper\ArrayHelper; use WBW\Library\SmsMode\Api\RequestInterface; -use WBW\Library\Types\Helper\ArrayHelper; /** * Request serializer. diff --git a/src/Serializer/ResponseDeserializer.php b/src/Serializer/ResponseDeserializer.php index fc5a6d6..fa316b1 100644 --- a/src/Serializer/ResponseDeserializer.php +++ b/src/Serializer/ResponseDeserializer.php @@ -14,6 +14,7 @@ namespace WBW\Library\SmsMode\Serializer; use DateTime; +use WBW\Library\Common\Helper\ArrayHelper; use WBW\Library\SmsMode\Api\ResponseInterface; use WBW\Library\SmsMode\Model\DeliveryReport; use WBW\Library\SmsMode\Model\SentSmsMessage; @@ -34,7 +35,6 @@ use WBW\Library\SmsMode\Response\SendingUnicodeSmsResponse; use WBW\Library\SmsMode\Response\SentSmsMessageListResponse; use WBW\Library\SmsMode\Response\TransferringCreditsResponse; -use WBW\Library\Types\Helper\ArrayHelper; /** * Response deserializer.