| 1 | <?php |
||
| 9 | class DNSCheckValidation implements EmailValidation |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var EmailParser |
||
| 13 | */ |
||
| 14 | private $parser; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var array |
||
| 18 | */ |
||
| 19 | private $warnings = []; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var InvalidEmail |
||
| 23 | */ |
||
| 24 | private $error; |
||
| 25 | |||
| 26 | 11 | public function isValid($email, EmailLexer $emailLexer) |
|
| 27 | { |
||
| 28 | // use the input to check DNS if we cannot extract something similar to a domain |
||
| 29 | 11 | $host = $email; |
|
| 30 | |||
| 31 | // Arguable pattern to extract the domain. Not aiming to validate the domain nor the email |
||
| 32 | 11 | if (false !== $lastAtPos = strrpos($email, '@')) { |
|
| 33 | 11 | $host = substr($email, $lastAtPos + 1); |
|
| 34 | 11 | } |
|
| 35 | |||
| 36 | 11 | return $this->checkDNS($host); |
|
| 37 | } |
||
| 38 | |||
| 39 | 1 | public function getError() |
|
| 43 | |||
| 44 | 1 | public function getWarnings() |
|
| 48 | |||
| 49 | 11 | protected function checkDNS($host) |
|
| 63 | } |
||
| 64 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..