Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
ExpressionLanguage example
return
$name
;
}
}
private
function
getExpressionLanguage
(
)
: ExpressionLanguage
{
if
(
null ===
$this
->expressionLanguage
)
{
if
(
!
class_exists
(
\Symfony\Component\ExpressionLanguage\ExpressionLanguage::
class
)
)
{
throw
new
LogicException
(
'Unable to use expressions as the Symfony ExpressionLanguage component is not installed.'
)
;
}
$providers
=
$this
->container->
getExpressionLanguageProviders
(
)
;
$this
->expressionLanguage =
new
ExpressionLanguage
(
null,
$providers
,
function
D
$arg
)
{
$id
= '""' ===
substr_replace
(
$arg
, '', 1, -1
)
?
stripcslashes
(
substr
(
$arg
, 1, -1
)
)
: null;
if
(
null !==
$id
&&
(
$this
->container->
hasAlias
(
$id
)
||
$this
->container->
hasDefinition
(
$id
)
)
)
{
return
$this
->
getServiceCall
(
$id
)
;
}
return
sprintf
(
'$this->get(%s)',
$arg
)
;
}
)
;
if
(
$this
->container->
isTrackingResources
(
)
)
{
foreach
(
$providers
as
$provider
)
{