mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
59 lines
1.1 KiB
PHP
59 lines
1.1 KiB
PHP
<?php
|
|
/**
|
|
* Orange Management
|
|
*
|
|
* PHP Version 7.1
|
|
*
|
|
* @category TBD
|
|
* @copyright Dennis Eichhorn
|
|
* @license OMS License 1.0
|
|
* @version 1.0.0
|
|
* @link http://website.orange-management.de
|
|
*/
|
|
declare(strict_types = 1);
|
|
|
|
namespace phpOMS\Validation\Network;
|
|
|
|
use phpOMS\Validation\ValidatorAbstract;
|
|
|
|
/**
|
|
* Validator abstract.
|
|
*
|
|
* @category Validation
|
|
* @package Framework
|
|
* @license OMS License 1.0
|
|
* @link http://website.orange-management.de
|
|
* @since 1.0.0
|
|
*/
|
|
class Email extends ValidatorAbstract
|
|
{
|
|
|
|
/**
|
|
* Constructor.
|
|
*
|
|
* @since 1.0.0
|
|
* @codeCoverageIgnore
|
|
*/
|
|
private function __construct()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public static function isValid($value, array $constraints = null) : bool
|
|
{
|
|
if (filter_var($value, FILTER_VALIDATE_EMAIL) === false) {
|
|
self::$msg = 'Invalid Email by filter_var standards';
|
|
self::$error = 1;
|
|
|
|
return false;
|
|
}
|
|
|
|
self::$msg = '';
|
|
self::$error = 0;
|
|
|
|
return true;
|
|
}
|
|
}
|