You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Validates that the value is a valid email address.
21
+
* Defines validation options to check that the value is a valid email address.
22
+
*
23
+
* @see EmailHandler
23
24
*
24
25
* @psalm-import-type WhenType from WhenInterface
25
26
*/
@@ -30,61 +31,54 @@ final class Email implements RuleWithOptionsInterface, SkipOnErrorInterface, Whe
30
31
use SkipOnErrorTrait;
31
32
use WhenTrait;
32
33
34
+
/**
35
+
* @param string $pattern The regular expression used to validate the value. See {@link https://www.regular-expressions.info/email.html}.
36
+
* @param string $fullPattern The regular expression used to validate email addresses with the name part.
37
+
* This property is used only when {@see $allowName} is `true`.
38
+
* @param string $idnEmailPattern The regular expression used to validate complex emails when {@see $enableIdn} is `true`.
39
+
* @param bool $allowName bool Whether to allow a name in the email address (e.g. "John Smith <[email protected]>").
40
+
* Defaults to `false`. See {@see $fullPattern}.
41
+
* @param bool $checkDns bool Whether to check email's domain exists and has either an A or MX record.
42
+
* Be aware that this check can fail due to temporary DNS problems even if the email address is
43
+
* valid and an email would be deliverable. Defaults to `false`.
44
+
* @param bool $enableIdn Whether validation process should take IDN (internationalized domain names) into account.
45
+
* Defaults to `false` meaning that validation of emails containing IDN will always fail.
46
+
* Note that in order to use IDN validation you have to install and enable `intl` PHP extension,
47
+
* otherwise an exception will be thrown.
48
+
* @param string $incorrectInputMessage A message used when the input is incorrect.
49
+
*
50
+
* You may use the following placeholders in the message:
51
+
*
52
+
* - `{attribute}`: the label of the attribute being validated.
53
+
* - `{type}`: the type of the attribute being validated.
54
+
* @param string $message A message used when the value is not valid.
55
+
*
56
+
* You may use the following placeholders in the message:
57
+
*
58
+
* - `{attribute}`: the label of the attribute being validated.
59
+
* - `{value}`: the value of the attribute being validated.
60
+
* @param bool|callable|null $skipOnEmpty Whether to skip this rule if the value validated is empty. See {@see SkipOnEmptyInterface}.
61
+
* @param bool $skipOnError Whether to skip this rule if any of the previous rules gave an error. See {@see SkipOnErrorInterface}.
62
+
* @param Closure|null $when A callable to define a condition for applying the rule. See {@see WhenInterface}.
63
+
* @psalm-param WhenType $when
64
+
*
65
+
* @throws RuntimeException If there was an attempt to enable IDN ({@see $enableIdn}), but "intl" PHP extension is
66
+
* not installed or not enabled.
67
+
*/
33
68
publicfunction__construct(
34
-
#[Language('RegExp')]
35
-
/**
36
-
* @var string the regular expression used to validate value.
0 commit comments