Download the PHP package nepada/email-address without Composer
On this page you can find all versions of the php package nepada/email-address. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nepada/email-address
More information about nepada/email-address
Files in nepada/email-address
Package email-address
Short Description Email address value object.
License BSD-3-Clause
Informations about the package email-address
Email address value object
Installation
Via Composer:
Usage
This package provides two implementations of email address value object:
1) RfcEmailAddress
- it adheres to RFCs and treats local part of email address as case sensitive. The domain part is normalized to lower case ASCII representation.
2) CaseInsensitiveEmailAddress
- the only difference from RfcEmailAddress
is that local part is considered case insensitive and normalized to lower case.
It is up to you to decide which implementation suites your needs. If you want to support both implementations, use Nepada\EmailAddress\EmailAddress
as a typehint. You can also cast one representation to the other using RfcEmailAddress::toCaseInsensitiveEmailAddress()
and CaseInsensitiveEmailAddress::toRfcEmailAddress()
.
Creating value object
Nepada\EmailAddress\InvalidEmailAddressException
is thrown in case of invalid input value.
Converting back to string
Casting the value object to string, will result in the original (non-canonical) string representation of email address:
Canonical string representation of email address
Getting normalized local and domain part separately
Integrations
- nepada/email-address-doctrine - Email address type for Doctrine.
- nepada/email-address-input - Email address form input for Nette forms.
All versions of email-address with dependencies
ext-intl Version *
ext-mbstring Version *
nette/utils Version ^3.2@dev || ^4.0@dev