From 5883be51384a58a08b1a441fd049915e7ec817bd Mon Sep 17 00:00:00 2001 From: Chris Galliano Date: Fri, 7 Feb 2020 14:25:56 +0200 Subject: [PATCH] fix number element type casting --- src/Forms/Elements/Input/Number/NumberInputElement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Forms/Elements/Input/Number/NumberInputElement.php b/src/Forms/Elements/Input/Number/NumberInputElement.php index 3b4f1df..dabb7ef 100644 --- a/src/Forms/Elements/Input/Number/NumberInputElement.php +++ b/src/Forms/Elements/Input/Number/NumberInputElement.php @@ -50,7 +50,7 @@ public function name(): string public function handle(ParametersInterface $parameters): ElementValidationResultsCollectionInterface { - $this->setValue($parameters->has($this->name()) ? $parameters->require($this->name()) : 0.0); + $this->setValue($parameters->has($this->name()) ? (float)$parameters->require($this->name()) : 0.0); $this->validationResult = $this->validator->validate($this); return new ElementValidationResultsCollection( new ElementValidationResult($this, $this->validationResult)