ValueObjects\Web\EmailAddress::__construct PHP Метод

__construct() публичный Метод

Returns an EmailAddress object given a PHP native string as parameter.
public __construct ( string $value )
$value string
    public function __construct($value)
    {
        $filteredValue = filter_var($value, FILTER_VALIDATE_EMAIL);
        if ($filteredValue === false) {
            throw new InvalidNativeArgumentException($value, array('string (valid email address)'));
        }
        $this->value = $filteredValue;
    }