Address
in package
FinalYes
Tags
Table of Contents
Constants
- FROM_STRING_PATTERN = '~(?<displayName>[^<]*)<(?<addrSpec>.*)>[^>]*~'
- A regex that matches a structure like 'Name <email@address.com>'.
Properties
- $address : mixed
- $encoder : mixed
- $name : mixed
- $validator : mixed
Methods
- __construct() : mixed
- create() : self
- createArray() : array<string|int, Address>
- fromString() : self
- 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
$address
private
mixed
$address
$encoder
private
static mixed
$encoder
$name
private
mixed
$name
$validator
private
static mixed
$validator
Methods
__construct()
public
__construct(string $address[, string $name = '' ]) : mixed
Parameters
- $address : string
- $name : string = ''
create()
public
static create(Address|string $address) : self
Parameters
- $address : Address|string
Return values
selfcreateArray()
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>fromString()
public
static fromString(string $string) : self
Parameters
- $string : string
Tags
Return values
selfgetAddress()
public
getAddress() : string
Return values
stringgetEncodedAddress()
public
getEncodedAddress() : string
Return values
stringgetEncodedName()
public
getEncodedName() : string
Return values
stringgetName()
public
getName() : string
Return values
stringtoString()
public
toString() : string