eee
This commit is contained in:
@@ -18,6 +18,9 @@ class Phone implements ValidatorInterface
|
|||||||
*/
|
*/
|
||||||
public function dispatch(mixed $data, object $class): bool
|
public function dispatch(mixed $data, object $class): bool
|
||||||
{
|
{
|
||||||
|
if ($data == null || !is_numeric($data)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return preg_match(self::REG, $data);
|
return preg_match(self::REG, $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,9 @@ class Round implements ValidatorInterface
|
|||||||
*/
|
*/
|
||||||
public function dispatch(mixed $data, object $class): bool
|
public function dispatch(mixed $data, object $class): bool
|
||||||
{
|
{
|
||||||
return round($data, $this->value) === $data;
|
if ($data === null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return round((float)$data, $this->value) === $data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user