EmailValidator
EmailValidator copied to clipboard
Add mailbox validator
Thanks for exhaustive review. I try to fix all issue and comments it.
Thanks for the changes @IvanLutokhin . I have done a couple of comments more. Please also check the test failure for PHP 5.5.
Yes, I added getter for property responseCode in InvalidMailbox and resolve magic method __toString() I think that's enough and interface is not necessary.
I fixed unit test for php 5.5 also. The problem was in deprecated methods phpunit.
Apparently there´s an error for hhvm within Travis, hence the failure. But the rest is passing.
@IvanLutokhin regarding the exception, __toString is a potential solution. However this would be the only error exception that has a getResponseCode method so if someone wants to do something with it the only way would be to test against the class name of the returned error. By providing an specific type that would be easier. It will also allow you to provide a wider range of error responses and codes following the table you shared, which would be great to have. Happy to find a solution together! Thanks again for the time you are investing into the feature!
Apparently there´s an error for hhvm within Travis, hence the failure. But the rest is passing.
HHVM does not support composer anymore. https://hhvm.com/blog/2019/02/11/hhvm-4.0.0.html
As one of the solutions to fix the version HHVM 3.30.
Thanks @IvanLutokhin , I'll do that. I'll be working to merge the PR shortly. Thanks for your patience.
@IvanLutokhin do you need any help on this PR?