Fixed exception.

This commit is contained in:
Jan Böhmer 2020-03-29 23:54:14 +02:00
parent a28e81065f
commit e3800e4a24

View file

@ -62,17 +62,15 @@ class AmountFormatter
/**
* Formats the given value using the measurement unit and options.
*
* @param float|string|int $value
* @param MeasurementUnit|null $unit The measurement unit, whose unit symbol should be used for formatting.
* If set to null, it is assumed that the part amount is measured in pieces.
*
* @param MeasurementUnit|null $unit The measurement unit, whose unit symbol should be used for formatting.
* If set to null, it is assumed that the part amount is measured in pieces.
*
* @return string The formatted string
*
* @throws InvalidArgumentException thrown if $value is not numeric
*/
public function format(float $value, ?MeasurementUnit $unit = null, array $options = [])
public function format($value, ?MeasurementUnit $unit = null, array $options = [])
{
if (! is_numeric($value)) {
throw new InvalidArgumentException('$value must be an numeric value!');