diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a6d30e4..14dd9a5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,8 +9,8 @@ jobs: strategy: fail-fast: true matrix: - php: [7.4, 8.0] - laravel: [8.*] + php: [7.4, 8.0, 8.1] + laravel: [8.*, 9.*] dependency-version: [prefer-lowest, prefer-stable] name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} diff --git a/CHANGELOG.md b/CHANGELOG.md index ece8a06..c3fd2fb 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to `netgsm` will be documented in this file ## Unreleased +## [4.3.0] - 2022-02-08 + +- Laravel 9 support added. + ## [4.2.0] - 2021-06-03 - PHP 8 support added. diff --git a/composer.json b/composer.json index 7701393..bb4a217 100755 --- a/composer.json +++ b/composer.json @@ -31,11 +31,11 @@ } ], "require": { - "php": "^7.4 || ^8.0", + "php": "^7.4|^8.0|^8.1", "guzzlehttp/guzzle": "^7.1", - "illuminate/support": "^8.0", - "illuminate/notifications": "^8.0", - "illuminate/translation": "^8.0", + "illuminate/support": "^8.0|^9.0", + "illuminate/notifications": "^8.0|^9.0", + "illuminate/translation": "^8.0|^9.0", "nesbot/carbon": "^2.0", "ext-simplexml": "*" }, @@ -43,7 +43,7 @@ "fakerphp/faker": "^1.14", "phpunit/phpunit": "^9.4", "mockery/mockery": "^1.4", - "orchestra/testbench": "^6.0" + "orchestra/testbench": "^6.0|^7.0" }, "autoload": { "psr-4": { diff --git a/src/Balance/NetgsmAvailableCredit.php b/src/Balance/NetgsmAvailableCredit.php index 48c6182..f00c1fc 100644 --- a/src/Balance/NetgsmAvailableCredit.php +++ b/src/Balance/NetgsmAvailableCredit.php @@ -39,6 +39,7 @@ class NetgsmAvailableCredit extends NetgsmApiClient * extracts credit from the returned response. * * @return string + * * @throws NetgsmException */ public function parseResponse(): ?string diff --git a/src/Balance/NetgsmPackages.php b/src/Balance/NetgsmPackages.php index 11238a9..14b86d0 100644 --- a/src/Balance/NetgsmPackages.php +++ b/src/Balance/NetgsmPackages.php @@ -32,6 +32,7 @@ class NetgsmPackages extends NetgsmApiClient * handles the response and return the package list as an array. * * @return array + * * @throws NetgsmException */ public function parseResponse(): array @@ -61,6 +62,7 @@ public function parseResponse(): array * returns the packages list for associated netgsm account. * * @return array + * * @throws GuzzleException * @throws NetgsmException */ diff --git a/src/Exceptions/CouldNotSendNotification.php b/src/Exceptions/CouldNotSendNotification.php index 42c7096..fd9e1a1 100644 --- a/src/Exceptions/CouldNotSendNotification.php +++ b/src/Exceptions/CouldNotSendNotification.php @@ -9,8 +9,7 @@ class CouldNotSendNotification extends AbstractNetgsmException /** * Thrown when there's a bad request and an error is responded. * - * @param ClientException $exception - * + * @param ClientException $exception * @return static */ public static function NetgsmRespondedWithAnError(ClientException $exception) diff --git a/src/Iys/NetgsmIys.php b/src/Iys/NetgsmIys.php index 97d346f..3a3a8be 100644 --- a/src/Iys/NetgsmIys.php +++ b/src/Iys/NetgsmIys.php @@ -10,7 +10,7 @@ class NetgsmIys extends AbstractNetgsmIys /** * Add address request. * - * @param Add $request + * @param Add $request * @return $this */ public function addAddress(Add $request): NetgsmIys @@ -25,7 +25,7 @@ public function addAddress(Add $request): NetgsmIys /** * Search address request. * - * @param Search $request + * @param Search $request * @return $this */ public function searchAddress(Search $request): NetgsmIys diff --git a/src/Iys/Requests/Add.php b/src/Iys/Requests/Add.php index b64b7aa..3cf2d47 100644 --- a/src/Iys/Requests/Add.php +++ b/src/Iys/Requests/Add.php @@ -25,7 +25,7 @@ class Add protected ?int $retailerAccess; /** - * @param string $refId + * @param string $refId * @return $this */ public function setRefId(string $refId): self @@ -36,7 +36,7 @@ public function setRefId(string $refId): self } /** - * @param string $type + * @param string $type * @return $this */ public function setType(string $type): self @@ -47,7 +47,7 @@ public function setType(string $type): self } /** - * @param string $source + * @param string $source * @return $this */ public function setSource(string $source): self @@ -58,7 +58,7 @@ public function setSource(string $source): self } /** - * @param string $recipient + * @param string $recipient * @return $this */ public function setRecipient(string $recipient): self @@ -69,7 +69,7 @@ public function setRecipient(string $recipient): self } /** - * @param string $status + * @param string $status * @return $this */ public function setStatus(string $status): self @@ -80,7 +80,7 @@ public function setStatus(string $status): self } /** - * @param string $consentDate + * @param string $consentDate * @return $this */ public function setConsentDate(string $consentDate): self @@ -91,7 +91,7 @@ public function setConsentDate(string $consentDate): self } /** - * @param string $recipientType + * @param string $recipientType * @return $this */ public function setRecipientType(string $recipientType): self @@ -102,7 +102,7 @@ public function setRecipientType(string $recipientType): self } /** - * @param int|null $retailerCode + * @param int|null $retailerCode * @return $this */ public function setRetailerCode(?int $retailerCode): self @@ -113,7 +113,7 @@ public function setRetailerCode(?int $retailerCode): self } /** - * @param int|null $retailerAccess + * @param int|null $retailerAccess * @return $this */ public function setRetailerAccess(?int $retailerAccess): self @@ -124,7 +124,7 @@ public function setRetailerAccess(?int $retailerAccess): self } /** - * @param array $defaults + * @param array $defaults * @return $this */ public function setDefaults(array $defaults): self diff --git a/src/Iys/Requests/Search.php b/src/Iys/Requests/Search.php index 0b16d89..5b4eaad 100644 --- a/src/Iys/Requests/Search.php +++ b/src/Iys/Requests/Search.php @@ -15,7 +15,7 @@ class Search protected string $refId; /** - * @param string $type + * @param string $type * @return $this */ public function setType(string $type): self @@ -26,7 +26,7 @@ public function setType(string $type): self } /** - * @param string $recipient + * @param string $recipient * @return $this */ public function setRecipient(string $recipient): self @@ -37,7 +37,7 @@ public function setRecipient(string $recipient): self } /** - * @param string $recipientType + * @param string $recipientType * @return $this */ public function setRecipientType(string $recipientType): self @@ -48,7 +48,7 @@ public function setRecipientType(string $recipientType): self } /** - * @param string $refId + * @param string $refId * @return $this */ public function setRefId(string $refId): self @@ -59,7 +59,7 @@ public function setRefId(string $refId): self } /** - * @param array $defaults + * @param array $defaults * @return $this */ public function setDefaults(array $defaults): self diff --git a/src/Netgsm.php b/src/Netgsm.php index c6d6cee..6162fbe 100644 --- a/src/Netgsm.php +++ b/src/Netgsm.php @@ -21,6 +21,7 @@ class Netgsm /** * Netgsm constructor. + * * @param Client $client * @param array $credentials * @param array $defaults @@ -35,6 +36,7 @@ public function __construct(Client $client, array $credentials = [], array $defa /** * @param AbstractNetgsmMessage $netgsmMessage * @return mixed + * * @throws CouldNotSendNotification * @throws Exceptions\IncorrectPhoneNumberFormatException * @throws GuzzleException @@ -62,6 +64,7 @@ public function sendSms(AbstractNetgsmMessage $netgsmMessage) * @param $endDate * @param array $filters * @return Collection + * * @throws GuzzleException * @throws Exceptions\ReportException */ @@ -100,6 +103,7 @@ public function getReports( * Returns the remaining credits amount (TL) on the netgsm account. * * @return string + * * @throws Exceptions\NetgsmException * @throws GuzzleException */ @@ -116,6 +120,7 @@ public function getCredit() * Returns the available package list and their balances on the netgsm account. * * @return array + * * @throws Exceptions\NetgsmException * @throws GuzzleException */ diff --git a/src/NetgsmApiClient.php b/src/NetgsmApiClient.php index e219fb5..9c8bd17 100644 --- a/src/NetgsmApiClient.php +++ b/src/NetgsmApiClient.php @@ -47,6 +47,7 @@ public function setCredentials(array $credentials): self * @param null $params * @param array $headers * @return string + * * @throws GuzzleException */ protected function callApi($method, $url, $params = null, $headers = []) diff --git a/src/NetgsmChannel.php b/src/NetgsmChannel.php index d3ed363..348b056 100644 --- a/src/NetgsmChannel.php +++ b/src/NetgsmChannel.php @@ -20,8 +20,9 @@ public function __construct(Netgsm $netgsm) /** * Send the given notification. * - * @param $notifiable - * @param Notification $notification + * @param $notifiable + * @param Notification $notification + * * @throws Exceptions\CouldNotSendNotification * @throws GuzzleException * @throws IncorrectPhoneNumberFormatException diff --git a/src/Report/AbstractNetgsmReport.php b/src/Report/AbstractNetgsmReport.php index 4d66f2e..7b17f67 100644 --- a/src/Report/AbstractNetgsmReport.php +++ b/src/Report/AbstractNetgsmReport.php @@ -153,6 +153,7 @@ protected function formatValue($value, $format) * returns the netgsm basic sms reports as a collection. * * @return Collection + * * @throws GuzzleException * @throws ReportException */ @@ -191,6 +192,7 @@ public function getReports(): Collection * * @param $response * @return bool + * * @throws ReportException */ public function validateResponse($response): bool diff --git a/src/Report/NetgsmSmsDetailReport.php b/src/Report/NetgsmSmsDetailReport.php index a8cd619..fe22357 100644 --- a/src/Report/NetgsmSmsDetailReport.php +++ b/src/Report/NetgsmSmsDetailReport.php @@ -47,6 +47,7 @@ class NetgsmSmsDetailReport extends AbstractNetgsmReport /** * Sets the Netgsm service bulkId * If bulkId is set, type value is set to 0. + * * @see https://www.netgsm.com.tr/dokuman/#http-get-rapor * * @param mixed $bulkId @@ -85,6 +86,7 @@ public function processRow($line): array * * @param $response * @return Collection + * * @throws \TarfinLabs\Netgsm\Exceptions\ReportException */ public function parseResponse(string $response): Collection diff --git a/src/Report/NetgsmSmsReport.php b/src/Report/NetgsmSmsReport.php index 0512a69..fd1a842 100644 --- a/src/Report/NetgsmSmsReport.php +++ b/src/Report/NetgsmSmsReport.php @@ -77,6 +77,7 @@ class NetgsmSmsReport extends AbstractNetgsmReport /** * Sets the Netgsm service bulkId * If bulkId is set, type value is set to 1. + * * @see https://www.netgsm.com.tr/dokuman/#http-get-rapor * * @param string $bulkId @@ -119,6 +120,7 @@ protected function processRow(string $line): array * * @param string $response * @return Collection + * * @throws \TarfinLabs\Netgsm\Exceptions\ReportException */ public function parseResponse(string $response): Collection diff --git a/src/Sms/AbstractNetgsmMessage.php b/src/Sms/AbstractNetgsmMessage.php index 715fc91..af8c3ce 100644 --- a/src/Sms/AbstractNetgsmMessage.php +++ b/src/Sms/AbstractNetgsmMessage.php @@ -102,6 +102,7 @@ public static function create(string $message = null, array $defaults = []) /** * AbstractNetgsmMessage constructor. + * * @param array $defaults * @param string $message */ @@ -149,6 +150,7 @@ public function getRecipients(): array /** * set's the sms origin. + * * @see https://www.netgsm.com.tr/dokuman/#g%C3%B6nderici-ad%C4%B1-sorgulama * * @param null $header @@ -204,6 +206,7 @@ public function getSendMethod(): string * * @param string $sendMethod * @return $this + * * @throws Exception */ public function setSendMethod(string $sendMethod): self @@ -316,6 +319,7 @@ public function getJobId(): string * parses the response from api and returns job id. * * @return $this + * * @throws CouldNotSendNotification * @throws NetgsmException */ @@ -347,6 +351,7 @@ public function parseResponse(): self * sends a sms via get method. * * @return $this + * * @throws CouldNotSendNotification * @throws GuzzleException * @throws NetgsmException @@ -362,6 +367,7 @@ protected function sendViaGet(): self * sends a sms via xml method. * * @return $this + * * @throws CouldNotSendNotification * @throws GuzzleException * @throws NetgsmException @@ -379,6 +385,7 @@ protected function sendViaXml(): self * sends a sms via specified sending method. * * @return $this + * * @throws IncorrectPhoneNumberFormatException */ public function send() diff --git a/src/Sms/NetgsmSmsMessage.php b/src/Sms/NetgsmSmsMessage.php index 71eaed9..9d6ad18 100644 --- a/src/Sms/NetgsmSmsMessage.php +++ b/src/Sms/NetgsmSmsMessage.php @@ -27,6 +27,7 @@ class NetgsmSmsMessage extends AbstractNetgsmMessage /** * creates the xml request body for sms sending via xml post method. + * * @return string */ protected function createXmlPost(): string