Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getDeprecatedVersion example
$e
->
addSuggestions
(
$name
,
array_keys
(
$this
->env->
getTests
(
)
)
)
;
throw
$e
;
}
private
function
getTestNodeClass
(
TwigTest
$test
)
: string
{
if
(
$test
->
isDeprecated
(
)
)
{
$stream
=
$this
->parser->
getStream
(
)
;
$message
=
sprintf
(
'Twig Test "%s" is deprecated',
$test
->
getName
(
)
)
;
if
(
$test
->
getDeprecatedVersion
(
)
)
{
$message
.=
sprintf
(
' since version %s',
$test
->
getDeprecatedVersion
(
)
)
;
}
if
(
$test
->
getAlternative
(
)
)
{
$message
.=
sprintf
(
'. Use "%s" instead',
$test
->
getAlternative
(
)
)
;
}
$src
=
$stream
->
getSourceContext
(
)
;
$message
.=
sprintf
(
' in %s at line %d.',
$src
->
getPath
(
)
?:
$src
->
getName
(
)
,
$stream
->
getCurrent
(
)
->
getLine
(
)
)
;
@
trigger_error
(
$message
, \E_USER_DEPRECATED
)
;
}