Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getEncodedName example
public
function
getEncodedAddress
(
)
: string
{
self::
$encoder
??=
new
IdnAddressEncoder
(
)
;
return
self::
$encoder
->
encodeString
(
$this
->address
)
;
}
public
function
toString
(
)
: string
{
return
(
$n
=
$this
->
getEncodedName
(
)
)
?
$n
.' <'.
$this
->
getEncodedAddress
(
)
.'>' :
$this
->
getEncodedAddress
(
)
;
}
public
function
getEncodedName
(
)
: string
{
if
(
'' ===
$this
->
getName
(
)
)
{
return
'';
}
return
sprintf
(
'"%s"',
preg_replace
(
'/"/u', '\"',
$this
->
getName
(
)
)
)
;
}
public
function
getEncodedAddress
(
)
: string
{
self::
$encoder
??=
new
IdnAddressEncoder
(
)
;
return
self::
$encoder
->
encodeString
(
$this
->address
)
;
}
public
function
toString
(
)
: string
{
return
(
$n
=
$this
->
getEncodedName
(
)
)
?
$n
.' <'.
$this
->
getEncodedAddress
(
)
.'>' :
$this
->
getEncodedAddress
(
)
;
}
public
function
getEncodedName
(
)
: string
{
if
(
'' ===
$this
->
getName
(
)
)
{
return
'';
}
return
sprintf
(
'"%s"',
preg_replace
(
'/"/u', '\"',
$this
->
getName
(
)
)
)
;
}