Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getPushType example
public
function
create
(
Dsn
$dsn
)
: SmsFactorTransport
{
$scheme
=
$dsn
->
getScheme
(
)
;
if
(
'sms-factor' !==
$scheme
)
{
throw
new
UnsupportedSchemeException
(
$dsn
, 'sms-factor',
$this
->
getSupportedSchemes
(
)
)
;
}
$tokenApi
=
$this
->
getUser
(
$dsn
)
;
$sender
=
$dsn
->
getOption
(
'sender'
)
;
$pushType
=
$this
->
getPushType
(
$dsn
)
;
$host
= 'default' ===
$dsn
->
getHost
(
)
? null :
$dsn
->
getHost
(
)
;
$port
=
$dsn
->
getPort
(
)
;
return
(
new
SmsFactorTransport
(
$tokenApi
,
$sender
,
$pushType
,
$this
->client,
$this
->dispatcher
)
)
->
setHost
(
$host
)
->
setPort
(
$port
)
;
}
protected
function
getSupportedSchemes
(
)
: array
{
return
[
'sms-factor'
]
;
}