qqq
This commit is contained in:
@@ -65,12 +65,13 @@ class Validator
|
||||
foreach ($data as $key => $value) {
|
||||
if (property_exists($this->formData, $key)) {
|
||||
$type = new \ReflectionProperty($this->formData, $key);
|
||||
var_dump($type->getType());
|
||||
if (!($type->getType() instanceof \ReflectionUnionType)) {
|
||||
$value = match ($type->getType()?->getName()) {
|
||||
'int' => (int)$value,
|
||||
'float' => (float)$value,
|
||||
default => $value
|
||||
};
|
||||
}
|
||||
$this->formData->{$key} = $value;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user