narendra687 / php-email-address-validation

Automatically exported from code.google.com/p/php-email-address-validation
0 stars 0 forks source link

Patch for static calling. #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I made a quick patch so that this check becomes a oneliner. Just tested it
on a 1000 email real world dataset and works like a charm (See attached file)

I changed the name of the first function too, my call is:

$valid = EmailAddressValidator::validate($email);

Thanks for the great class :)

Original issue reported on code.google.com by schizoduckie on 30 Jun 2009 at 7:41

Attachments:

GoogleCodeExporter commented 9 years ago
I agree that a static method is better (there being no reason to instantiate an
EmailAddressValidator). Why not rename the method to "is_valid($email)"?

Original comment by ethan.sherrie on 22 Feb 2010 at 4:18

GoogleCodeExporter commented 9 years ago
Agreed. is_valid would be better. Instance approach can be usefull if there 
would be any additional configuration. For example, allow IP address or not, 
allow IDN or not, perform DNS lookup or not, perform black list check, or not.

Original comment by witold.b...@gmail.com on 30 Jun 2010 at 1:34