From cb8cf250a5433f9d2b029ef2a6ab8abd39f16419 Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Thu, 22 Jun 2023 13:54:41 +0200 Subject: [PATCH] Use php 8.0 for nextcloud 22 --- composer.json | 2 +- composer.lock | 4 ++-- lib/Controller/PageController.php | 5 +---- lib/Db/ReaderEntity.php | 2 +- lib/Hooks.php | 5 +---- 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/composer.json b/composer.json index 3bfa30b..cfeca10 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ }, "config": { "platform": { - "php": "7.4" + "php": "8.0" } } } diff --git a/composer.lock b/composer.lock index 9fb3687..7bb4677 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": "5c7be477b217d6074abc6c2f8d2c2256", + "content-hash": "7b806afecf0b4bd9cf2aed44f533eaf4", "packages": [], "packages-dev": [ { @@ -389,7 +389,7 @@ "platform": [], "platform-dev": [], "platform-overrides": { - "php": "7.4" + "php": "8.0" }, "plugin-api-version": "2.3.0" } diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index 2647b81..266a1a4 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -167,10 +167,7 @@ class PageController extends Controller { ]; } - /** - * @param mixed $value - */ - private function toJson($value): string { + private function toJson(array $value): string { return htmlspecialchars(json_encode($value), ENT_QUOTES, 'UTF-8'); } } diff --git a/lib/Db/ReaderEntity.php b/lib/Db/ReaderEntity.php index 6fa301d..66eb48a 100644 --- a/lib/Db/ReaderEntity.php +++ b/lib/Db/ReaderEntity.php @@ -24,7 +24,7 @@ abstract class ReaderEntity extends Entity { * * @return string|array */ - public function conditional_json_decode(string $el) { + public function conditional_json_decode(string $el): mixed { /** @var array $result */ $result = json_decode($el); if (json_last_error() === JSON_ERROR_NONE) { diff --git a/lib/Hooks.php b/lib/Hooks.php index 8ddfe7d..3c99361 100644 --- a/lib/Hooks.php +++ b/lib/Hooks.php @@ -79,10 +79,7 @@ class Hooks { $queryBuilder->executeStatement(); } - /** - * @param mixed $string - */ - private static function isJson($string): bool { + private static function isJson(mixed $string): bool { return is_string($string) && is_array(json_decode($string, true)) && json_last_error() == JSON_ERROR_NONE; } }