Correcting PHPStan type warning

PHPStan failed because of a binary operation "/" between string and 100.0.  Fixed this by casting the result of `str_replace` to a float.
This commit is contained in:
fjohnston@avatarasoftware.com
2022-11-04 08:51:07 -04:00
parent 21772479e1
commit 6439be5d14
+1 -1
View File
@@ -569,7 +569,7 @@ class StringHelper
public static function convertToNumberIfPercent(string &$operand): bool
{
if (strpos($operand, '%', -1) !== false) {
$operand = (str_replace('%', '', $operand) / 100.00);
$operand = ((float)(str_replace('%', '', $operand)) / 100.00);
return true;
}