From 10e2f64e15c44705bb4672ac95ca5f5b452af01e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=BDubom=C3=ADr=20Samotn=C3=BD?= Date: Fri, 12 Sep 2025 11:09:13 +0200 Subject: [PATCH] triv: fix deprecation warnings on nullable function args, set minimal php version --- composer.json | 4 ++++ composer.lock | 7 +++++-- lib/Api/TatraPayPlusAPIApi.php | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 13b3d5a..99b38d0 100644 --- a/composer.json +++ b/composer.json @@ -10,5 +10,9 @@ "psr-4": { "Tatrapayplus\\TatrapayplusApiClient\\" : "lib/" } + }, + "require": { + "php": ">=7.4", + "ext-json": "*" } } diff --git a/composer.lock b/composer.lock index f2306c4..70d363a 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": "80334d3ccc143b6306c0a2e9a86f4e74", + "content-hash": "5ae438bcb4207eb36f6345455061a28b", "packages": [], "packages-dev": [], "aliases": [], @@ -12,7 +12,10 @@ "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, - "platform": [], + "platform": { + "php": ">=7.4", + "ext-json": "*" + }, "platform-dev": [], "plugin-api-version": "2.2.0" } diff --git a/lib/Api/TatraPayPlusAPIApi.php b/lib/Api/TatraPayPlusAPIApi.php index 8ea2dd9..8903a68 100755 --- a/lib/Api/TatraPayPlusAPIApi.php +++ b/lib/Api/TatraPayPlusAPIApi.php @@ -978,7 +978,7 @@ public function setLogoRequest($appearance_logo_request) ); } - public static function generateSignedCardId(string $cid, string $public_key_content = null): string + public static function generateSignedCardId(string $cid, ?string $public_key_content = null): string { if (empty($public_key_content)) { $public_key_content = file_get_contents( @@ -989,7 +989,7 @@ public static function generateSignedCardId(string $cid, string $public_key_cont return TatraPayPlusService::generate_signed_card_id_from_cid($cid, $public_key_content); } - public function log(HttpResponse $response, array $additional_data = null): void + public function log(HttpResponse $response, ?array $additional_data = null): void { if (!is_null($this->logger)) { $this->logger->log($response, $additional_data);