Documentation

Address
in package

FinalYes
Tags
author

Fabien Potencier fabien@symfony.com

Table of Contents

Constants

FROM_STRING_PATTERN  = '~(?<displayName>[^<]*)<(?<addrSpec>.*)>[^>]*~'
A regex that matches a structure like 'Name <email@address.com>'.

Properties

$address  : string
$encoder  : IdnAddressEncoder
$name  : string
$validator  : EmailValidator

Methods

__construct()  : mixed
create()  : self
createArray()  : array<string|int, Address>
getAddress()  : string
getEncodedAddress()  : string
getEncodedName()  : string
getName()  : string
toString()  : string

Constants

FROM_STRING_PATTERN

A regex that matches a structure like 'Name <email@address.com>'.

private mixed FROM_STRING_PATTERN = '~(?<displayName>[^<]*)<(?<addrSpec>.*)>[^>]*~'

It matches anything between the first < and last > as email address. This allows to use a single string to construct an Address, which can be convenient to use in config, and allows to have more readable config. This does not try to cover all edge cases for address.

Properties

Methods

__construct()

public __construct(string $address[, string $name = '' ]) : mixed
Parameters
$address : string
$name : string = ''

create()

public static create(self|string $address) : self
Parameters
$address : self|string
Return values
self

createArray()

public static createArray(array<string|int, Address|string> $addresses) : array<string|int, Address>
Parameters
$addresses : array<string|int, Address|string>
Return values
array<string|int, Address>

getAddress()

public getAddress() : string
Return values
string

getEncodedAddress()

public getEncodedAddress() : string
Return values
string

getEncodedName()

public getEncodedName() : string
Return values
string

getName()

public getName() : string
Return values
string

toString()

public toString() : string
Return values
string

        
On this page

Search results