From d7c7e4169334bb6974efa4950dd0fd59f3c304b4 Mon Sep 17 00:00:00 2001 From: riv4wi Date: Thu, 18 May 2023 15:27:17 -0300 Subject: [PATCH] fix: fixed warnings for php versions greater than or equal to 8.1 --- src/Asset.php | 2 +- src/AssetType.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Asset.php b/src/Asset.php index 81afc51..196f87f 100644 --- a/src/Asset.php +++ b/src/Asset.php @@ -93,7 +93,7 @@ public function getMetadata() * which is a value of any type other than a resource. * @since 5.4.0 */ - public function jsonSerialize() + public function jsonSerialize(): mixed { return [ 'value' => $this->getValue(), diff --git a/src/AssetType.php b/src/AssetType.php index 384a89b..6694ae5 100644 --- a/src/AssetType.php +++ b/src/AssetType.php @@ -75,7 +75,7 @@ private function stableSort(&$array, $cmp_function = 'strcmp') return; } // Split the array in half - $halfway = count($array) / 2; + $halfway = (int)(count($array) / 2); $array1 = array_slice($array, 0, $halfway); $array2 = array_slice($array, $halfway); // Recurse to sort the two halves @@ -141,7 +141,7 @@ public function getValues() : array * which is a value of any type other than a resource. * @since 5.4.0 */ - public function jsonSerialize() + public function jsonSerialize(): mixed { return array_map(function (Asset $asset) { return $asset->jsonSerialize();