Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
isTrivialInstance example
if
(
!
$def
->
isDeprecated
(
)
)
{
foreach
(
$this
->
getClasses
(
$def
)
as
$class
)
{
$this
->
collectLineage
(
$class
,
$lineage
)
;
}
}
}
foreach
(
$this
->serviceCalls
as
$id
=>
[
$callCount
,
$behavior
]
)
{
if
(
'service_container' !==
$id
&&
$id
!==
$cId
&& ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE !==
$behavior
&&
$this
->container->
has
(
$id
)
&&
$this
->
isTrivialInstance
(
$def
=
$this
->container->
findDefinition
(
$id
)
)
)
{
foreach
(
$this
->
getClasses
(
$def
)
as
$class
)
{
$this
->
collectLineage
(
$class
,
$lineage
)
;
}
}
}
foreach
(
array_diff_key
(
array_flip
(
$lineage
)
,
$this
->inlinedRequires
)
as
$file
=>
$class
)
{
$code
.=
sprintf
(
" include_once %s;\n",
$file
)
;
}
}
if
(
!
$def
->
isDeprecated
(
)
)
{
foreach
(
$this
->
getClasses
(
$def
,
$cId
)
as
$class
)
{
$this
->
collectLineage
(
$class
,
$lineage
)
;
}
}
}
foreach
(
$this
->serviceCalls
as
$id
=>
[
$callCount
,
$behavior
]
)
{
if
(
'service_container' !==
$id
&&
$id
!==
$cId
&& ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE !==
$behavior
&&
$this
->container->
has
(
$id
)
&&
$this
->
isTrivialInstance
(
$def
=
$this
->container->
findDefinition
(
$id
)
)
)
{
foreach
(
$this
->
getClasses
(
$def
,
$cId
)
as
$class
)
{
$this
->
collectLineage
(
$class
,
$lineage
)
;
}
}
}
foreach
(
array_diff_key
(
array_flip
(
$lineage
)
,
$this
->inlinedRequires
)
as
$file
=>
$class
)
{
$code
.=
sprintf
(
" include_once %s;\n",
$file
)
;
}
}
if
(
!
$def
->
isDeprecated
(
)
)
{
foreach
(
$this
->
getClasses
(
$def
,
$cId
)
as
$class
)
{
$this
->
collectLineage
(
$class
,
$lineage
)
;
}
}
}
foreach
(
$this
->serviceCalls
as
$id
=>
[
$callCount
,
$behavior
]
)
{
if
(
'service_container' !==
$id
&&
$id
!==
$cId
&& ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE !==
$behavior
&&
$this
->container->
has
(
$id
)
&&
$this
->
isTrivialInstance
(
$def
=
$this
->container->
findDefinition
(
$id
)
)
)
{
foreach
(
$this
->
getClasses
(
$def
,
$cId
)
as
$class
)
{
$this
->
collectLineage
(
$class
,
$lineage
)
;
}
}
}
foreach
(
array_diff_key
(
array_flip
(
$lineage
)
,
$this
->inlinedRequires
)
as
$file
=>
$class
)
{
$code
.=
sprintf
(
" include_once %s;\n",
$file
)
;
}
}