From 083da68644d230b8a4b1d8201ed832a5206d3d5c Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Willms Date: Thu, 15 Jan 2026 11:07:43 +0100 Subject: fix signature of Exercise::normalizeFloat() to really make the unit parameter optional, fixes #6139 Closes #6139 Merge request studip/studip!4670 --- lib/models/vips/Exercise.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/models/vips/Exercise.php b/lib/models/vips/Exercise.php index a4ef00a..17214b8 100644 --- a/lib/models/vips/Exercise.php +++ b/lib/models/vips/Exercise.php @@ -15,7 +15,7 @@ abstract class Exercise extends SimpleORMap * The unpacked value from the "task" column in the SORM instance. * This is an array, but type hinting does not work due to SORM * writing the JSON string into this property on restore(). - */ + */ public $task = []; /** @@ -706,10 +706,10 @@ abstract class Exercise extends SimpleORMap * Return a normalized version of a float (and optionally a unit) * * @param string $string string to be normalized - * @param string $unit will contain the unit text + * @param string|null $unit will contain the unit text * @return float The normalized value */ - protected function normalizeFloat(string $string, string &$unit): float + protected function normalizeFloat(string $string, ?string &$unit = null): float { static $si_scale = [ 'T' => 12, -- cgit v1.0