Pull merge.
[yaffs-website] / vendor / egulias / email-validator / src / Egulias / EmailValidator / EmailValidatorInterface.php
1 <?php
2
3 namespace Egulias\EmailValidator;
4
5 /**
6  * EmailValidatorInterface
7  *
8  * @author Chris McCafferty <cilefen@gmail.com>
9  */
10 interface EmailValidatorInterface
11 {
12     /**
13      * Validates an email address against the following standards:
14      *
15      * RFC-5321: Simple Mail Transfer Protocol
16      * RFC-5322: Internet Message Format
17      * RFC-6530: Overview and Framework for Internationalized Email
18      * RFC-6531: SMTP Extension for Internationalized Email
19      * RFC-6532: Internationalized Email Headers
20      * RFC-1123 section 2.1: Requirements for Internet Hosts -- Application and Support
21      * RFC-4291 section 2.2: IP Version 6 Addressing Architecture
22      *
23      * @param string $email    The email address to validate.
24      * @param bool   $checkDNS Whether or not the email address's hostname should
25      *                         be confirmed with a DNS lookup. This only comes
26      *                         into play if strict mode is also enabled.
27      * @param bool   $strict   If this is true, and any informational warnings
28      *                         were raised during validation, the email address
29      *                         will be considered invalid. Additionally, if
30      *                         $checkDNS is true and the DNS lookup failed,
31      *                         the email address will be considered invalid.
32      * @return bool
33      */
34     public function isValid($email, $checkDNS = false, $strict = false);
35
36     /**
37      * @return bool
38      */
39     public function hasWarnings();
40
41     /**
42      * @return array
43      */
44     public function getWarnings();
45
46     /**
47      * @return string
48      */
49     public function getError();
50
51     /**
52      * @param int $threshold The acceptable number of deprecation warnings.
53      *
54      * @return EmailValidator
55      */
56     public function setThreshold($threshold);
57
58     /**
59      * @return int
60      */
61     public function getThreshold();
62 }