From 50d2276a78cb09675baf954cb55739c84f09457e Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Tue, 26 Jul 2022 11:00:03 +0200 Subject: [PATCH 1/5] adjust changelog # Conflicts: # CHANGELOG.md --- CHANGELOG.md | 53 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37f62c9..78a1501 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,42 +1,51 @@ # Changelog +All notable changes to this project will be documented in this file. ---- +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## 1.3.0.0 (2022-07-18) +## [Unreleased] -- tests use generated example phone numbers -- move recipient checks from list to recipient itself +## [1.3.0] - 2022-07-18 +### Added - tests added ---- - -## 1.2.1.0 (2022-07-15) +### Changed +- tests use generated example phone numbers +- move recipient checks from list to recipient itself +## [1.2.1] - 2022-07-15 +### Changed - extend log messages - sanitize special phone number format before request ---- - -## 1.2.0.0 (2022-07-14) - -- make sender number optional -- assign sender address type only if sender is set +## [1.2.0] - 2022-07-14 +### Added - collect exception messages in a class - collect URI parts in a class + +### Changed +- make sender number optional +- assign sender address type only if sender is set - extract logger handler from client ---- - -## 1.1.0.0 (2022-07-13) - +## [1.1.0] - 2022-07-13 +### Added - make installable in PHP 8 + +### Removed - remove unused dependency ---- - -## 1.0.0.0 (2022-07-13) - +## [1.0.0] - 2022-07-13 +### Added - initial implementation - SMS requests (text or binary) - SMS responses - - recipient managing \ No newline at end of file + - recipient managing + +[Unreleased]: https://git.d3data.de/D3Private/linkmobility-php-client/compare/1.3.0...HEAD +[1.3.0]: https://git.d3data.de/D3Private/linkmobility-php-client/compare/1.2.1...1.3.0 +[1.2.1]: https://git.d3data.de/D3Private/linkmobility-php-client/compare/1.2.0...1.2.1 +[1.2.0]: https://git.d3data.de/D3Private/linkmobility-php-client/compare/1.1.0...1.2.0 +[1.1.0]: https://git.d3data.de/D3Private/linkmobility-php-client/compare/1.0.0...1.1.0 +[1.0.0]: https://git.d3data.de/D3Private/linkmobility-php-client/releases/tag/1.0.0 \ No newline at end of file From 491c26087031e4daaaecf2d50acb189368f8703e Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Wed, 27 Jul 2022 09:31:46 +0200 Subject: [PATCH 2/5] add request methods to it's interface --- src/Request/RequestInterface.php | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/Request/RequestInterface.php b/src/Request/RequestInterface.php index f9ca82e..129aa6e 100644 --- a/src/Request/RequestInterface.php +++ b/src/Request/RequestInterface.php @@ -16,6 +16,7 @@ declare(strict_types=1); namespace D3\LinkmobilityClient\Request; use D3\LinkmobilityClient\Client; +use D3\LinkmobilityClient\RecipientsList\RecipientsListInterface; use D3\LinkmobilityClient\ValueObject\SmsMessageInterface; use InvalidArgumentException; use Psr\Http\Message\ResponseInterface as PsrResponseInterface; @@ -42,9 +43,18 @@ interface RequestInterface public const SENDERADDRESSTYPE_ALPHANUMERIC = 'alphanumeric'; public const SENDERADDRESSTYPE_SHORTCODE = 'shortcode'; + /** + * @param SmsMessageInterface $message + * @param Client $client + */ public function __construct(SmsMessageInterface $message, Client $client); - public function setMethod(string $method); + /** + * @param string $method + * + * @return Request + */ + public function setMethod(string $method): Request; /** * Must return the HTTP verb for this request, i.e. GET, POST, PUT @@ -53,6 +63,18 @@ interface RequestInterface */ public function getMethod(): string; + /** + * @param bool $test + * + * @return Request + */ + public function setTestMode(bool $test): Request; + + /** + * @return bool + */ + public function getTestMode(): bool; + /** * Must return the URI for the request with a leading slash, i.e. /messages.json * @@ -81,6 +103,11 @@ interface RequestInterface */ public function getResponseInstance(PsrResponseInterface $rawResponse): LMResponseInterface; + /** + * @return RecipientsListInterface + */ + public function getRecipientsList(): RecipientsListInterface; + /** * Must return the options for this request. If there are none, return [] (empty array) * From 1a9389d76313415e666bf21c00dc22838076a7ad Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Wed, 27 Jul 2022 09:35:25 +0200 Subject: [PATCH 3/5] improve changelog # Conflicts: # CHANGELOG.md --- CHANGELOG.md | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78a1501..d95f94c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [Unreleased](https://git.d3data.de/D3Private/linkmobility-php-client/compare/1.3.0...rel_1.x) -## [1.3.0] - 2022-07-18 +## [1.3.0](https://git.d3data.de/D3Private/linkmobility-php-client/compare/1.2.1...1.3.0) - 2022-07-18 ### Added - tests added @@ -14,12 +14,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - tests use generated example phone numbers - move recipient checks from list to recipient itself -## [1.2.1] - 2022-07-15 +## [1.2.1](https://git.d3data.de/D3Private/linkmobility-php-client/compare/1.2.0...1.2.1) - 2022-07-15 ### Changed - extend log messages - sanitize special phone number format before request -## [1.2.0] - 2022-07-14 +## [1.2.0](https://git.d3data.de/D3Private/linkmobility-php-client/compare/1.1.0...1.2.0) - 2022-07-14 ### Added - collect exception messages in a class - collect URI parts in a class @@ -29,23 +29,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - assign sender address type only if sender is set - extract logger handler from client -## [1.1.0] - 2022-07-13 +## [1.1.0](https://git.d3data.de/D3Private/linkmobility-php-client/compare/1.0.0...1.1.0) - 2022-07-13 ### Added - make installable in PHP 8 ### Removed - remove unused dependency -## [1.0.0] - 2022-07-13 +## [1.0.0](https://git.d3data.de/D3Private/linkmobility-php-client/releases/tag/1.0.0) - 2022-07-13 ### Added - initial implementation - SMS requests (text or binary) - SMS responses - recipient managing - -[Unreleased]: https://git.d3data.de/D3Private/linkmobility-php-client/compare/1.3.0...HEAD -[1.3.0]: https://git.d3data.de/D3Private/linkmobility-php-client/compare/1.2.1...1.3.0 -[1.2.1]: https://git.d3data.de/D3Private/linkmobility-php-client/compare/1.2.0...1.2.1 -[1.2.0]: https://git.d3data.de/D3Private/linkmobility-php-client/compare/1.1.0...1.2.0 -[1.1.0]: https://git.d3data.de/D3Private/linkmobility-php-client/compare/1.0.0...1.1.0 -[1.0.0]: https://git.d3data.de/D3Private/linkmobility-php-client/releases/tag/1.0.0 \ No newline at end of file From 4cd0ab0d177e64523f49ee2578306d80104db8a8 Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Thu, 28 Jul 2022 10:07:37 +0200 Subject: [PATCH 4/5] fix wrong return type of LoggerHandler::getInstance # Conflicts: # src/LoggerHandler.php --- src/LoggerHandler.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/LoggerHandler.php b/src/LoggerHandler.php index a79794c..e4eb4fd 100644 --- a/src/LoggerHandler.php +++ b/src/LoggerHandler.php @@ -20,10 +20,14 @@ use Psr\Log\NullLogger; class LoggerHandler { + /** @var LoggerHandler */ private static $instance = null; private $logger; - public static function getInstance() + /** + * @return LoggerHandler + */ + public static function getInstance(): LoggerHandler { if (self::$instance === null) { self::$instance = new self(); From f4d5e544484cd51e819d68740d9b0d8e2a77b506 Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Thu, 28 Jul 2022 10:47:20 +0200 Subject: [PATCH 5/5] adjust version informations --- CHANGELOG.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d95f94c..ba40415 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://git.d3data.de/D3Private/linkmobility-php-client/compare/1.3.0...rel_1.x) +## [Unreleased](https://git.d3data.de/D3Private/linkmobility-php-client/compare/1.3.1...rel_1.x) + +## [1.3.1](https://git.d3data.de/D3Private/linkmobility-php-client/compare/1.3.0...1.3.1) - 2022-07-28 +### Changed +- improve code quality + +### Fixed +- wrong return type of LoggerHandler::getInstance ## [1.3.0](https://git.d3data.de/D3Private/linkmobility-php-client/compare/1.2.1...1.3.0) - 2022-07-18 ### Added