From c1f088985a9d532827538a5bfed054ef16adc3bb Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Wed, 28 Dec 2022 00:11:00 +0100 Subject: [PATCH] improve docblocks --- src/Application/Model/Configuration.php | 2 +- .../Model/Exceptions/abortSendingExceptionInterface.php | 4 +++- src/Application/Model/MessageTypes/AbstractMessage.php | 3 +-- src/Application/Model/MessageTypes/Sms.php | 2 +- src/Application/Model/OrderRecipients.php | 1 + src/Application/Model/RequestFactory.php | 1 - 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Application/Model/Configuration.php b/src/Application/Model/Configuration.php index 1e46abb..342b0bf 100644 --- a/src/Application/Model/Configuration.php +++ b/src/Application/Model/Configuration.php @@ -63,7 +63,7 @@ class Configuration /** * @return string|null */ - public function getSmsSenderNumber() + public function getSmsSenderNumber(): ?string { /** @var string $number */ $number = Registry::getConfig()->getConfigParam(self::SMS_SENDERNR); diff --git a/src/Application/Model/Exceptions/abortSendingExceptionInterface.php b/src/Application/Model/Exceptions/abortSendingExceptionInterface.php index 6c4f2a4..f4b8f5f 100644 --- a/src/Application/Model/Exceptions/abortSendingExceptionInterface.php +++ b/src/Application/Model/Exceptions/abortSendingExceptionInterface.php @@ -15,6 +15,8 @@ declare(strict_types=1); namespace D3\Linkmobility4OXID\Application\Model\Exceptions; -interface abortSendingExceptionInterface extends \Throwable +use Throwable; + +interface abortSendingExceptionInterface extends Throwable { } diff --git a/src/Application/Model/MessageTypes/AbstractMessage.php b/src/Application/Model/MessageTypes/AbstractMessage.php index b8c9f18..54ec508 100644 --- a/src/Application/Model/MessageTypes/AbstractMessage.php +++ b/src/Application/Model/MessageTypes/AbstractMessage.php @@ -74,7 +74,7 @@ abstract class AbstractMessage /** * @return ResponseInterface|null */ - public function getResponse() + public function getResponse(): ?ResponseInterface { return $this->response; } @@ -94,7 +94,6 @@ abstract class AbstractMessage public function getRecipientsList(): string { $list = []; - /** @var Recipient $recipient */ foreach ($this->recipients as $recipient) { $list[] = $recipient->get(); } diff --git a/src/Application/Model/MessageTypes/Sms.php b/src/Application/Model/MessageTypes/Sms.php index 8cfe6bf..42cd22c 100644 --- a/src/Application/Model/MessageTypes/Sms.php +++ b/src/Application/Model/MessageTypes/Sms.php @@ -137,7 +137,7 @@ class Sms extends AbstractMessage return $response->isSuccessful(); } catch (abortSendingExceptionInterface $e) { Registry::getLogger()->warning($e->getMessage()); - // Oxid does not accept throwable interface only exceptions according by definition + // Oxid does not accept throwable interface only exceptions according to definition Registry::getUtilsView()->addErrorToDisplay($e->getMessage()); } catch (GuzzleException $e) { Registry::getLogger()->warning($e->getMessage()); diff --git a/src/Application/Model/OrderRecipients.php b/src/Application/Model/OrderRecipients.php index b77bed2..61df427 100644 --- a/src/Application/Model/OrderRecipients.php +++ b/src/Application/Model/OrderRecipients.php @@ -52,6 +52,7 @@ class OrderRecipients /** @var string $countryId */ $countryId = $this->order->getFieldData(trim($countryIdFieldName)); $country->load($countryId); + /** @var Recipient $recipient */ return oxNew(Recipient::class, $content, $country->getFieldData('oxisoalpha2')); } } catch (NumberParseException $e) { diff --git a/src/Application/Model/RequestFactory.php b/src/Application/Model/RequestFactory.php index fe47e19..7f0004c 100644 --- a/src/Application/Model/RequestFactory.php +++ b/src/Application/Model/RequestFactory.php @@ -25,7 +25,6 @@ class RequestFactory extends \D3\LinkmobilityClient\SMS\RequestFactory { $configuration = oxNew(Configuration::class); - /** @var SmsRequestInterface $request */ $request = parent::getSmsRequest(); $request->setTestMode($configuration->getTestMode()) ->setSenderAddress(