From f5762b9e481ddb3a8bff221d5a0e419eabc1aebf Mon Sep 17 00:00:00 2001 From: Martin Beranek Date: Tue, 14 May 2024 09:39:07 +0200 Subject: [PATCH 1/3] Allow-int-in-EndpointIdentifier-version --- src/EndpointIdentifier.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/EndpointIdentifier.php b/src/EndpointIdentifier.php index e91a102..fae66a8 100644 --- a/src/EndpointIdentifier.php +++ b/src/EndpointIdentifier.php @@ -16,8 +16,9 @@ class EndpointIdentifier implements EndpointInterface private $apiAction; - public function __construct(string $method, string $version, string $package, ?string $apiAction = null) + public function __construct(string $method, string|int $version, string $package, ?string $apiAction = null) { + $version = (string) $version; $this->method = strtoupper($method); if (strpos($version, '/') !== false) { throw new InvalidArgumentException('Version must have semantic numbering. For example "1", "1.1", "0.13.2" etc.'); From f37afb606900a849b26f6292790410f950d13cac Mon Sep 17 00:00:00 2001 From: Martin Beranek Date: Tue, 14 May 2024 09:43:26 +0200 Subject: [PATCH 2/3] Allow-int-in-EndpointIdentifier-version --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2cdc4a..3eb7cf3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip ## [Unreleased][unreleased] #### Changed -* [BC] Support for semantic versioning api. Need retype version from `int` to `string`. +* Support for semantic versioning api. * [BC] DefaultHandler response code 404 instead 400 #### Added From d5c21a235985155ab6f7586808370a0c044359c9 Mon Sep 17 00:00:00 2001 From: Martin Beranek Date: Tue, 14 May 2024 09:50:31 +0200 Subject: [PATCH 3/3] Allow-int-in-EndpointIdentifier-version --- src/EndpointIdentifier.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/EndpointIdentifier.php b/src/EndpointIdentifier.php index fae66a8..43fae40 100644 --- a/src/EndpointIdentifier.php +++ b/src/EndpointIdentifier.php @@ -16,7 +16,13 @@ class EndpointIdentifier implements EndpointInterface private $apiAction; - public function __construct(string $method, string|int $version, string $package, ?string $apiAction = null) + /** + * @param string $method example: "GET", "POST", "PUT", "DELETE" + * @param string|int $version Version must have semantic numbering. For example "1", "1.1", "0.13.2" etc. + * @param string $package example: "users" + * @param string|null $apiAction example: "query" + */ + public function __construct(string $method, $version, string $package, ?string $apiAction = null) { $version = (string) $version; $this->method = strtoupper($method);