diff --git a/README.md b/README.md index 3b9a2f2..5db4c5c 100644 --- a/README.md +++ b/README.md @@ -1,51 +1,51 @@ -EmailValidator [![Build Status](https://travis-ci.org/egulias/EmailValidator.png?branch=master)](https://travis-ci.org/egulias/EmailValidator) [![Coverage Status](https://coveralls.io/repos/egulias/EmailValidator/badge.png?branch=master)](https://coveralls.io/r/egulias/EmailValidator?branch=master) [![SensioLabsInsight](https://insight.sensiolabs.com/projects/b18d473e-bd5a-4d88-a7b2-7aeaee0ebd7b/small.png)](https://insight.sensiolabs.com/projects/b18d473e-bd5a-4d88-a7b2-7aeaee0ebd7b)[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/egulias/EmailValidator/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/egulias/EmailValidator/?branch=master) -============================= - -##Installation## -Install via composer. Add to your current compooser.json ```require``` key: ```"egulias/email-validator":"1.0.x-dev" ``` - -##Usage## - -Simple example: - -```php -isValid($email)) { - echo $email . ' is a valid email address'; -} -``` - -More advanced example (returns detailed diagnostic error codes): - -```php -isValid($email); - -if ($result) { - echo $email . ' is a valid email address'; -} else if ($validator->hasWarnings()) { - echo 'Warning! ' . $email . ' has unusual/deprecated features (result code ' . var_export($validator->getWarnings(), true) . ')'; -} else { - echo $email . ' is not a valid email address (result code ' . $validator->getError() . ')'; -} -``` - -##Contributors## -As this is a port from another library and work, here are other people related to the previous: - -* Ricard Clau [@ricardclau](http://github.com/ricardclau): Performance against PHP built-in filter_var -* Josepf Bielawski [@stloyd](http://github.com/stloyd): For its first re-work of Dominic's lib -* Dominic Sayers [@dominicsayers](http://github.com/dominicsayers): The original isemail function - -##License## -Released under the MIT License attached with this code. - +EmailValidator [![Build Status](https://travis-ci.org/egulias/EmailValidator.png?branch=master)](https://travis-ci.org/egulias/EmailValidator) [![Coverage Status](https://coveralls.io/repos/egulias/EmailValidator/badge.png?branch=master)](https://coveralls.io/r/egulias/EmailValidator?branch=master) [![SensioLabsInsight](https://insight.sensiolabs.com/projects/b18d473e-bd5a-4d88-a7b2-7aeaee0ebd7b/small.png)](https://insight.sensiolabs.com/projects/b18d473e-bd5a-4d88-a7b2-7aeaee0ebd7b)[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/egulias/EmailValidator/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/egulias/EmailValidator/?branch=master) +============================= + +##Installation## +Install via composer. Add to your current compooser.json ```require``` key: ```"egulias/email-validator":"1.0.x-dev" ``` + +##Usage## + +Simple example: + +```php +isValid($email)) { + echo $email . ' is a valid email address'; +} +``` + +More advanced example (returns detailed diagnostic error codes): + +```php +isValid($email); + +if ($result) { + echo $email . ' is a valid email address'; +} else if ($validator->hasWarnings()) { + echo 'Warning! ' . $email . ' has unusual/deprecated features (result code ' . var_export($validator->getWarnings(), true) . ')'; +} else { + echo $email . ' is not a valid email address (result code ' . $validator->getError() . ')'; +} +``` + +##Contributors## +As this is a port from another library and work, here are other people related to the previous: + +* Ricard Clau [@ricardclau](http://github.com/ricardclau): Performance against PHP built-in filter_var +* Josepf Bielawski [@stloyd](http://github.com/stloyd): For its first re-work of Dominic's lib +* Dominic Sayers [@dominicsayers](http://github.com/dominicsayers): The original isemail function + +##License## +Released under the MIT License attached with this code. + diff --git a/composer.lock b/composer.lock index e7c1abd..3e5a485 100644 --- a/composer.lock +++ b/composer.lock @@ -1,9 +1,10 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" + "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" ], - "hash": "cca347a6b95164b1121e034b95f824ec", + "hash": "9e9dff0cc08c7292600453e681201e13", "packages": [ { "name": "doctrine/lexer", @@ -61,16 +62,16 @@ "packages-dev": [ { "name": "guzzle/guzzle", - "version": "v3.9.1", + "version": "v3.9.2", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle3.git", - "reference": "92d9934f2fca1da15178c91239576ae26e505e60" + "reference": "54991459675c1a2924122afbb0e5609ade581155" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/92d9934f2fca1da15178c91239576ae26e505e60", - "reference": "92d9934f2fca1da15178c91239576ae26e505e60", + "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/54991459675c1a2924122afbb0e5609ade581155", + "reference": "54991459675c1a2924122afbb0e5609ade581155", "shasum": "" }, "require": { @@ -114,7 +115,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.8-dev" + "dev-master": "3.9-dev" } }, "autoload": { @@ -149,7 +150,7 @@ "rest", "web service" ], - "time": "2014-05-07 17:04:22" + "time": "2014-08-11 04:32:36" }, { "name": "psr/log", @@ -195,18 +196,18 @@ "source": { "type": "git", "url": "https://github.com/satooshi/php-coveralls.git", - "reference": "b7271847c84d160f5b0aae83e45c225e8ffc96f4" + "reference": "94389a0ebdb64857d6899b5e0254dffa99e5aa96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/satooshi/php-coveralls/zipball/b7271847c84d160f5b0aae83e45c225e8ffc96f4", - "reference": "b7271847c84d160f5b0aae83e45c225e8ffc96f4", + "url": "https://api.github.com/repos/satooshi/php-coveralls/zipball/94389a0ebdb64857d6899b5e0254dffa99e5aa96", + "reference": "94389a0ebdb64857d6899b5e0254dffa99e5aa96", "shasum": "" }, "require": { "ext-json": "*", "ext-simplexml": "*", - "guzzle/guzzle": ">=3.0", + "guzzle/guzzle": ">=2.7", "php": ">=5.3", "psr/log": "1.0.0", "symfony/config": ">=2.0", @@ -216,7 +217,7 @@ }, "require-dev": { "apigen/apigen": "2.8.*@stable", - "pdepend/pdepend": "dev-master", + "pdepend/pdepend": "dev-master as 2.0.0", "phpmd/phpmd": "dev-master", "phpunit/php-invoker": ">=1.1.0,<1.2.0", "phpunit/phpunit": "3.7.*@stable", @@ -262,21 +263,21 @@ "github", "test" ], - "time": "2014-05-14 13:09:37" + "time": "2014-07-09 10:45:38" }, { "name": "symfony/config", - "version": "v2.4.5", + "version": "v2.5.4", "target-dir": "Symfony/Component/Config", "source": { "type": "git", "url": "https://github.com/symfony/Config.git", - "reference": "2effc67af6f21a0d267210b72d0b0b691d113528" + "reference": "080eabdc256c1d7a3a7cf6296271edb68eb1ab2b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Config/zipball/2effc67af6f21a0d267210b72d0b0b691d113528", - "reference": "2effc67af6f21a0d267210b72d0b0b691d113528", + "url": "https://api.github.com/repos/symfony/Config/zipball/080eabdc256c1d7a3a7cf6296271edb68eb1ab2b", + "reference": "080eabdc256c1d7a3a7cf6296271edb68eb1ab2b", "shasum": "" }, "require": { @@ -286,7 +287,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "2.5-dev" } }, "autoload": { @@ -299,49 +300,49 @@ "MIT" ], "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony Config Component", "homepage": "http://symfony.com", - "time": "2014-04-22 08:11:06" + "time": "2014-08-31 03:22:04" }, { "name": "symfony/console", - "version": "v2.4.5", + "version": "v2.5.4", "target-dir": "Symfony/Component/Console", "source": { "type": "git", "url": "https://github.com/symfony/Console.git", - "reference": "24f723436e62598c9dddee2a8573d6992504dc5d" + "reference": "748beed2a1e73179c3f5154d33fe6ae100c1aeb1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/24f723436e62598c9dddee2a8573d6992504dc5d", - "reference": "24f723436e62598c9dddee2a8573d6992504dc5d", + "url": "https://api.github.com/repos/symfony/Console/zipball/748beed2a1e73179c3f5154d33fe6ae100c1aeb1", + "reference": "748beed2a1e73179c3f5154d33fe6ae100c1aeb1", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { + "psr/log": "~1.0", "symfony/event-dispatcher": "~2.1" }, "suggest": { + "psr/log": "For using the console logger", "symfony/event-dispatcher": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "2.5-dev" } }, "autoload": { @@ -354,41 +355,42 @@ "MIT" ], "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony Console Component", "homepage": "http://symfony.com", - "time": "2014-05-14 21:48:29" + "time": "2014-08-14 16:10:54" }, { "name": "symfony/event-dispatcher", - "version": "v2.4.5", + "version": "v2.5.4", "target-dir": "Symfony/Component/EventDispatcher", "source": { "type": "git", "url": "https://github.com/symfony/EventDispatcher.git", - "reference": "e539602e5455aa086c0e81e604745af7789e4d8a" + "reference": "8faf5cc7e80fde74a650a36e60d32ce3c3e0457b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/e539602e5455aa086c0e81e604745af7789e4d8a", - "reference": "e539602e5455aa086c0e81e604745af7789e4d8a", + "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/8faf5cc7e80fde74a650a36e60d32ce3c3e0457b", + "reference": "8faf5cc7e80fde74a650a36e60d32ce3c3e0457b", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "symfony/dependency-injection": "~2.0" + "psr/log": "~1.0", + "symfony/config": "~2.0", + "symfony/dependency-injection": "~2.0", + "symfony/stopwatch": "~2.2" }, "suggest": { "symfony/dependency-injection": "", @@ -397,7 +399,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "2.5-dev" } }, "autoload": { @@ -410,34 +412,32 @@ "MIT" ], "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony EventDispatcher Component", "homepage": "http://symfony.com", - "time": "2014-04-16 10:34:31" + "time": "2014-07-28 13:20:46" }, { "name": "symfony/filesystem", - "version": "v2.4.5", + "version": "v2.5.4", "target-dir": "Symfony/Component/Filesystem", "source": { "type": "git", "url": "https://github.com/symfony/Filesystem.git", - "reference": "a3af8294bcce4a7c1b2892363b0c9d8109affad4" + "reference": "a765efd199e02ff4001c115c318e219030be9364" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Filesystem/zipball/a3af8294bcce4a7c1b2892363b0c9d8109affad4", - "reference": "a3af8294bcce4a7c1b2892363b0c9d8109affad4", + "url": "https://api.github.com/repos/symfony/Filesystem/zipball/a765efd199e02ff4001c115c318e219030be9364", + "reference": "a765efd199e02ff4001c115c318e219030be9364", "shasum": "" }, "require": { @@ -446,7 +446,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "2.5-dev" } }, "autoload": { @@ -459,34 +459,32 @@ "MIT" ], "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony Filesystem Component", "homepage": "http://symfony.com", - "time": "2014-04-16 10:34:31" + "time": "2014-09-03 09:00:14" }, { "name": "symfony/stopwatch", - "version": "v2.4.5", + "version": "v2.5.4", "target-dir": "Symfony/Component/Stopwatch", "source": { "type": "git", "url": "https://github.com/symfony/Stopwatch.git", - "reference": "343bcc0360f2c22f371884b8f6a9fee8d1aa431a" + "reference": "22ab4f76cdeefd38b00022a6be5709190a2fd046" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/343bcc0360f2c22f371884b8f6a9fee8d1aa431a", - "reference": "343bcc0360f2c22f371884b8f6a9fee8d1aa431a", + "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/22ab4f76cdeefd38b00022a6be5709190a2fd046", + "reference": "22ab4f76cdeefd38b00022a6be5709190a2fd046", "shasum": "" }, "require": { @@ -495,7 +493,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "2.5-dev" } }, "autoload": { @@ -508,34 +506,32 @@ "MIT" ], "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony Stopwatch Component", "homepage": "http://symfony.com", - "time": "2014-04-18 20:37:09" + "time": "2014-08-14 16:10:54" }, { "name": "symfony/yaml", - "version": "v2.4.5", + "version": "v2.5.4", "target-dir": "Symfony/Component/Yaml", "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "fd22bb88c3a6f73c898b39bec185a9e211b06265" + "reference": "01a7695bcfb013d0a15c6757e15aae120342986f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/fd22bb88c3a6f73c898b39bec185a9e211b06265", - "reference": "fd22bb88c3a6f73c898b39bec185a9e211b06265", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/01a7695bcfb013d0a15c6757e15aae120342986f", + "reference": "01a7695bcfb013d0a15c6757e15aae120342986f", "shasum": "" }, "require": { @@ -544,7 +540,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "2.5-dev" } }, "autoload": { @@ -557,20 +553,18 @@ "MIT" ], "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony Yaml Component", "homepage": "http://symfony.com", - "time": "2014-05-12 09:27:48" + "time": "2014-08-31 03:22:04" } ], "aliases": [ @@ -580,6 +574,7 @@ "stability-flags": { "satooshi/php-coveralls": 20 }, + "prefer-stable": false, "platform": { "php": ">= 5.3.3" }, diff --git a/src/Egulias/EmailValidator/EmailValidator.php b/src/Egulias/EmailValidator/EmailValidator.php index 34da636..80e6227 100644 --- a/src/Egulias/EmailValidator/EmailValidator.php +++ b/src/Egulias/EmailValidator/EmailValidator.php @@ -2,8 +2,6 @@ namespace Egulias\EmailValidator; -use Egulias\EmailValidator\Parser\LocalPart; - /** * EmailValidator * diff --git a/src/Egulias/EmailValidator/Parser/DomainPart.php b/src/Egulias/EmailValidator/Parser/DomainPart.php index d622b94..b81961c 100644 --- a/src/Egulias/EmailValidator/Parser/DomainPart.php +++ b/src/Egulias/EmailValidator/Parser/DomainPart.php @@ -295,5 +295,4 @@ class DomainPart extends Parser throw new \InvalidArgumentException('ERR_EXPECTING_ATEXT'); } } - -} \ No newline at end of file +} diff --git a/src/Egulias/EmailValidator/Parser/Parser.php b/src/Egulias/EmailValidator/Parser/Parser.php index b62b405..1aaea76 100644 --- a/src/Egulias/EmailValidator/Parser/Parser.php +++ b/src/Egulias/EmailValidator/Parser/Parser.php @@ -187,4 +187,4 @@ abstract class Parser throw new \InvalidArgumentException("ERR_FWS_CRLF_END"); } } -} \ No newline at end of file +}