From ef1dd318d437bb33adddf226c546e85f4744ce8c Mon Sep 17 00:00:00 2001 From: Asko Nõmm Date: Mon, 25 Sep 2023 01:35:47 +0300 Subject: Update stuff --- src/Validators/EmailValidator.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/Validators/EmailValidator.php') diff --git a/src/Validators/EmailValidator.php b/src/Validators/EmailValidator.php index 180c22d..bbb237f 100644 --- a/src/Validators/EmailValidator.php +++ b/src/Validators/EmailValidator.php @@ -1,12 +1,14 @@ + * @author Asko Nomm */ class EmailValidator implements Validator { @@ -18,9 +20,9 @@ class EmailValidator implements Validator * @param mixed $modifier * @return boolean */ - public static function validate(string $field, mixed $value, mixed $modifier = null): bool + public function validate(string $field, mixed $value, mixed $modifier = null): bool { - return filter_var($value, FILTER_VALIDATE_EMAIL); + return !!filter_var($value, FILTER_VALIDATE_EMAIL); } /** @@ -30,8 +32,8 @@ class EmailValidator implements Validator * @param mixed $modifier * @return string */ - public static function composeError(string $field, mixed $modifier = null): string + public function composeError(string $field, mixed $modifier = null): string { - return "${field} is not a valid e-mail address."; + return "{$field} is not a valid e-mail address."; } } -- cgit v1.2.3