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();