Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getProxyDumper example
unset
(
$lineage
[
$class
]
)
;
$lineage
[
$class
]
=
substr
(
$exportedFile
, 1, -1
)
;
}
private
function
generateProxyClasses
(
)
: array
{
$proxyClasses
=
[
]
;
$alreadyGenerated
=
[
]
;
$definitions
=
$this
->container->
getDefinitions
(
)
;
$strip
= '' ===
$this
->docStar;
$proxyDumper
=
$this
->
getProxyDumper
(
)
;
ksort
(
$definitions
)
;
foreach
(
$definitions
as
$id
=>
$definition
)
{
if
(
!
$definition
=
$this
->
isProxyCandidate
(
$definition
,
$asGhostObject
,
$id
)
)
{
continue
;
}
if
(
isset
(
$alreadyGenerated
[
$asGhostObject
]
[
$class
=
$definition
->
getClass
(
)
]
)
)
{
continue
;
}
$alreadyGenerated
[
$asGhostObject
]
[
$class
]
= true;
foreach
(
array_column
(
$definition
->
getTag
(
'proxy'
)
, 'interface'
)
?:
[
$class
]
as
$r
)
{
if
(
!
str_starts_with
(
$baseClass
=
$options
[
'base_class'
]
, '\\'
)
&& 'Container' !==
$baseClass
)
{
$baseClass
=
sprintf
(
'%s\%s',
$options
[
'namespace'
]
? '\\'.
$options
[
'namespace'
]
: '',
$baseClass
)
;
$this
->baseClass =
$baseClass
;
}
elseif
(
'Container' ===
$baseClass
)
{
$this
->baseClass = Container::
class
;
}
else
{
$this
->baseClass =
$baseClass
;
}
$this
->
initializeMethodNamesMap
(
'Container' ===
$baseClass
? Container::
class
D
$baseClass
)
;
if
(
$this
->
getProxyDumper
(
)
instanceof NullDumper
)
{
(
new
AnalyzeServiceReferencesPass
(
true, false
)
)
->
process
(
$this
->container
)
;
try
{
(
new
CheckCircularReferencesPass
(
)
)
->
process
(
$this
->container
)
;
}
catch
(
ServiceCircularReferenceException
$e
)
{
$path
=
$e
->
getPath
(
)
;
end
(
$path
)
;
$path
[
key
(
$path
)
]
.= '". Try running "composer require symfony/proxy-manager-bridge';
throw
new
ServiceCircularReferenceException
(
$e
->
getServiceId
(
)
,
$path
)
;
}
}
unset
(
$lineage
[
$class
]
)
;
$lineage
[
$class
]
=
substr
(
$exportedFile
, 1, -1
)
;
}
private
function
generateProxyClasses
(
)
: array
{
$proxyClasses
=
[
]
;
$alreadyGenerated
=
[
]
;
$definitions
=
$this
->container->
getDefinitions
(
)
;
$strip
= '' ===
$this
->docStar &&
method_exists
(
Kernel::
class
, 'stripComments'
)
;
$proxyDumper
=
$this
->
getProxyDumper
(
)
;
ksort
(
$definitions
)
;
foreach
(
$definitions
as
$id
=>
$definition
)
{
if
(
!
$definition
=
$this
->
isProxyCandidate
(
$definition
,
$asGhostObject
,
$id
)
)
{
continue
;
}
if
(
isset
(
$alreadyGenerated
[
$asGhostObject
]
[
$class
=
$definition
->
getClass
(
)
]
)
)
{
continue
;
}
$alreadyGenerated
[
$asGhostObject
]
[
$class
]
= true;
foreach
(
array_column
(
$definition
->
getTag
(
'proxy'
)
, 'interface'
)
?:
[
$class
]
as
$r
)
{