API / Minn\Support / Email

Email final class

Minn\Support\Email · public/minn/src/Minn/Support/Email.php · 69 lines

The address rules the reference applies: a local part from a fixed character class, a dotted domain of hyphen-trimmed labels. `check` names the first rule an address breaks; `sanitize` strips what it can and names why it gave up.

Constants and properties

privateLOCAL_CHARACTER = 'a-zA-Z0-9!#$%&\'*+\\/=?^_`{|}~\\.-'

Public

staticcheck(string $email): ?string#

Why an address is invalid, or null when it passes the reference's checks.

staticsanitize(string $raw): array#

An address with the characters the reference strips removed, and what was removed.

@return array{0: string, 1: string|null} the cleaned address (empty when refused) and the reason