diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2026-01-15 11:07:43 +0100 |
|---|---|---|
| committer | Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de> | 2026-01-15 11:07:43 +0100 |
| commit | 083da68644d230b8a4b1d8201ed832a5206d3d5c (patch) | |
| tree | a4e56fddb0ab4ddd0755d5bddb85bbc39774a5ef /lib/models | |
| parent | 78e46de33b3f205aae375d1ea6d4fe088e0e5124 (diff) | |
fix signature of Exercise::normalizeFloat() to really make the unit parameter optional, fixes #6139
Closes #6139
Merge request studip/studip!4670
Diffstat (limited to 'lib/models')
| -rw-r--r-- | lib/models/vips/Exercise.php | 6 |
1 files 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, |
