Bring $value_text2 to a defined state

This commit is contained in:
Frank Fenor 2024-03-31 11:47:46 +02:00
parent 1a66ef1cfe
commit f8db489c0d
No known key found for this signature in database
GPG key ID: E6B5029FCCE96376

View file

@ -75,6 +75,8 @@ class ParameterDTO
if (!empty($unit) && preg_match('/^(.+' . preg_quote($unit) . ')\s*(.+)$/', $parts[1], $matches) > 0) { if (!empty($unit) && preg_match('/^(.+' . preg_quote($unit) . ')\s*(.+)$/', $parts[1], $matches) > 0) {
$parts[1] = $matches[1]; $parts[1] = $matches[1];
$value_text2 = $matches[2]; $value_text2 = $matches[2];
} else {
$value_text2 = null;
} }
[$number2, $unit2] = self::splitIntoValueAndUnit(ltrim($parts[1], " +")) ?? [$parts[1], null]; [$number2, $unit2] = self::splitIntoValueAndUnit(ltrim($parts[1], " +")) ?? [$parts[1], null];