From 2b80ec88056764dd07037511c6e8c8303775c9e3 Mon Sep 17 00:00:00 2001 From: Frank Fenor Date: Wed, 3 Apr 2024 17:09:42 +0200 Subject: [PATCH] Correct some inaccuacies in comments --- src/Services/InfoProviderSystem/DTOs/ParameterDTO.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Services/InfoProviderSystem/DTOs/ParameterDTO.php b/src/Services/InfoProviderSystem/DTOs/ParameterDTO.php index 619ce2ce..0b525b88 100644 --- a/src/Services/InfoProviderSystem/DTOs/ParameterDTO.php +++ b/src/Services/InfoProviderSystem/DTOs/ParameterDTO.php @@ -65,7 +65,7 @@ class ParameterDTO return new self($name, value_typ: (float) $value, value_text: $value_text, unit: $unit, symbol: $symbol, group: $group); } - //If the attribute contains a tilde we assume it is a range + //If the attribute contains "..." or a tilde we assume it is a range if (preg_match('/(\.{3}|~)/', $value) === 1) { $parts = preg_split('/\s*(\.{3}|~)\s*/', $value); if (count($parts) === 2) { @@ -84,7 +84,7 @@ class ParameterDTO } [$number2, $unit2] = self::splitIntoValueAndUnit(ltrim($parts[1], " +")) ?? [$parts[1], $unit]; - //If both parts have the same unit and both values are numerical, we assume it is a range + //If both parts have the same unit and both values are numerical, we'll save it as range if ($unit === $unit2 && is_numeric($number) && is_numeric($number2)) { return new self(name: $name, value_min: (float) $number, value_max: (float) $number2, value_text: $value_text2, unit: $unit, symbol: $symbol, group: $group); }