diff options
| author | Asko Nõmm <asko@repl.ee> | 2023-09-25 01:35:47 +0300 |
|---|---|---|
| committer | Asko Nõmm <asko@repl.ee> | 2023-09-25 01:35:47 +0300 |
| commit | ef1dd318d437bb33adddf226c546e85f4744ce8c (patch) | |
| tree | 8910bd4cc0b2ce2827aecfa19ecf2453058af575 /src/Validators/EmailValidator.php | |
| parent | d2a1290423e1102b23fc8e042cef5420a42c02af (diff) | |
Update stuff
Diffstat (limited to 'src/Validators/EmailValidator.php')
| -rw-r--r-- | src/Validators/EmailValidator.php | 14 |
1 files changed, 8 insertions, 6 deletions
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 @@ <?php -namespace Askonomm\Hird\Validators; +declare(strict_types=1); + +namespace Asko\Hird\Validators; /** * Implements an e-mail validator that has a job * of validating e-mail addresses. * - * @author Asko Nomm <asko@bien.ee> + * @author Asko Nomm <asko@asko.dev> */ 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."; } } |
