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,9 +62,7 @@ class AmountFormatter
/** /**
* Formats the given value using the measurement unit and options. * Formats the given value using the measurement unit and options.
* *
* @param MeasurementUnit|null $unit The measurement unit, whose unit symbol should be used for formatting. * @param float|string|int $value
* 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. * @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. * If set to null, it is assumed that the part amount is measured in pieces.
* *
@ -72,7 +70,7 @@ class AmountFormatter
* *
* @throws InvalidArgumentException thrown if $value is not numeric * @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)) { if (! is_numeric($value)) {
throw new InvalidArgumentException('$value must be an numeric value!'); throw new InvalidArgumentException('$value must be an numeric value!');