Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
JsonNormalizer example
$a
=
new
\TSantos\Serializer\
NormalizerRegistry
(
)
;
$b
=
new
\TSantos\Serializer\Normalizer\
CollectionNormalizer
(
)
;
$c
=
new
\TSantos\Serializer\EventDispatcher\
EventDispatcher
(
)
;
$c
->
addSubscriber
(
new
\TSantos\SerializerBundle\EventListener\
StopwatchListener
(
new
\Symfony\Component\Stopwatch\
Stopwatch
(
true
)
)
)
;
$container
->services
[
'tsantos_serializer'
]
=
$instance
=
new
\TSantos\Serializer\
EventEmitterSerializer
(
new
\TSantos\Serializer\Encoder\
JsonEncoder
(
)
,
$a
,
$c
)
;
$b
->
setSerializer
(
$instance
)
;
$d
=
new
\TSantos\Serializer\Normalizer\
JsonNormalizer
(
)
;
$d
->
setSerializer
(
$instance
)
;
$a
->
add
(
new
\TSantos\Serializer\Normalizer\
ObjectNormalizer
(
new
\TSantos\SerializerBundle\Serializer\
CircularReferenceHandler
(
)
)
)
;
$a
->
add
(
$b
)
;
$a
->
add
(
$d
)
;
return
$instance
;
}
}