From c4e57c94af14e8cdd271e30d063fa6b195f362ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20B=C3=B6sing?= <2189546+boesing@users.noreply.github.com> Date: Wed, 24 Apr 2024 00:38:08 +0200 Subject: [PATCH] qa: add new template types to adapter options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This also bumps the minimum version of `laminas/laminas-stdlib` as templates were introduced in more recent versions. Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com> --- composer.json | 2 +- composer.lock | 2 +- src/Adapter/AbstractAdapter.php | 5 +++++ src/Adapter/AdapterOptions.php | 3 +++ src/Adapter/Json.php | 2 +- src/Adapter/PhpSerialize.php | 5 ++++- 6 files changed, 15 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index b950363..ca6b0de 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "php": "~8.1.0 || ~8.2.0 || ~8.3.0", "laminas/laminas-json": "^3.1", "laminas/laminas-servicemanager": "^4.1", - "laminas/laminas-stdlib": "^3.2" + "laminas/laminas-stdlib": "^3.19" }, "require-dev": { "laminas/laminas-coding-standard": "~2.5.0", diff --git a/composer.lock b/composer.lock index 3f7ae07..5cfabe5 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b9203dc212461a23ae3eb7ab29bca59b", + "content-hash": "da3d59c77d92d93721ec361e40661079", "packages": [ { "name": "brick/varexporter", diff --git a/src/Adapter/AbstractAdapter.php b/src/Adapter/AbstractAdapter.php index 3879ea6..18944ee 100644 --- a/src/Adapter/AbstractAdapter.php +++ b/src/Adapter/AbstractAdapter.php @@ -8,6 +8,9 @@ abstract class AbstractAdapter implements AdapterInterface { protected AdapterOptions|null $options = null; + /** + * @param iterable|AdapterOptions|null $options + */ public function __construct(iterable|AdapterOptions|null $options = null) { if ($options !== null) { @@ -17,6 +20,8 @@ public function __construct(iterable|AdapterOptions|null $options = null) /** * Set adapter options + * + * @param iterable|AdapterOptions $options */ public function setOptions(iterable|AdapterOptions $options): void { diff --git a/src/Adapter/AdapterOptions.php b/src/Adapter/AdapterOptions.php index 7f02dd7..f782e60 100644 --- a/src/Adapter/AdapterOptions.php +++ b/src/Adapter/AdapterOptions.php @@ -6,6 +6,9 @@ use Laminas\Stdlib\AbstractOptions; +/** + * @template-extends AbstractOptions + */ class AdapterOptions extends AbstractOptions { } diff --git a/src/Adapter/Json.php b/src/Adapter/Json.php index 846333d..a658384 100644 --- a/src/Adapter/Json.php +++ b/src/Adapter/Json.php @@ -16,7 +16,7 @@ final class Json extends AbstractAdapter /** * Set options * - * @param iterable|JsonOptions $options + * @param iterable|JsonOptions $options */ public function setOptions(iterable|AdapterOptions $options): void { diff --git a/src/Adapter/PhpSerialize.php b/src/Adapter/PhpSerialize.php index aac8509..ccd21ee 100644 --- a/src/Adapter/PhpSerialize.php +++ b/src/Adapter/PhpSerialize.php @@ -25,6 +25,9 @@ final class PhpSerialize extends AbstractAdapter /** @var PhpSerializeOptions|null */ protected AdapterOptions|null $options = null; + /** + * @param iterable|PhpSerializeOptions|null $options + */ public function __construct(iterable|PhpSerializeOptions|null $options = null) { // needed to check if a returned false is based on a serialize false @@ -39,7 +42,7 @@ public function __construct(iterable|PhpSerializeOptions|null $options = null) /** * Set options * - * @param iterable|PhpSerializeOptions $options + * @param iterable|PhpSerializeOptions $options */ public function setOptions(iterable|AdapterOptions $options): void {