<?php namespace JMS\SerializerBundle; use JMS\DiExtraBundle\DependencyInjection\Compiler\LazyServiceMapPass; use JMS\SerializerBundle\DependencyInjection\Compiler\CustomHandlersPass; use JMS\SerializerBundle\DependencyInjection\Compiler\DoctrinePass; use JMS\SerializerBundle\DependencyInjection\Compiler\FormErrorHandlerTranslationDomainPass; use JMS\SerializerBundle\DependencyInjection\Compiler\RegisterEventListenersAndSubscribersPass; use JMS\SerializerBundle\DependencyInjection\Compiler\ServiceMapPass; use JMS\SerializerBundle\DependencyInjection\Compiler\TwigExtensionPass; use Symfony\Component\DependencyInjection\Compiler\PassConfig; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\HttpKernel\Bundle\Bundle; class JMSSerializerBundle extends Bundle { public function build(ContainerBuilder $builder) { $builder->addCompilerPass($this->getServiceMapPass('jms_serializer.serialization_visitor', 'format', function (ContainerBuilder $container, Definition $def) { $container->getDefinition('jms_serializer.serializer')->replaceArgument(3, $def); } )); $builder->addCompilerPass($this->getServiceMapPass('jms_serializer.deserialization_visitor', 'format', function (ContainerBuilder $container, Definition $def) { $container->getDefinition('jms_serializer.serializer')->replaceArgument(4, $def); } )); $builder->addCompilerPass(new FormErrorHandlerTranslationDomainPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION); $builder->addCompilerPass(new TwigExtensionPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION); $builder->addCompilerPass(new RegisterEventListenersAndSubscribersPass(), PassConfig::TYPE_BEFORE_REMOVING); $builder->addCompilerPass(new CustomHandlersPass(), PassConfig::TYPE_BEFORE_REMOVING); $builder->addCompilerPass(new DoctrinePass(), PassConfig::TYPE_BEFORE_REMOVING); } private function getServiceMapPass($tagName, $keyAttributeName, $callable) { if (class_exists('JMS\DiExtraBundle\DependencyInjection\Compiler\LazyServiceMapPass')) { return new LazyServiceMapPass($tagName, $keyAttributeName, $callable); } return new ServiceMapPass($tagName, $keyAttributeName, $callable); } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
Cache | Folder | 0755 |
|
|
ContextFactory | Folder | 0755 |
|
|
DependencyInjection | Folder | 0755 |
|
|
ExpressionLanguage | Folder | 0755 |
|
|
Resources | Folder | 0755 |
|
|
Serializer | Folder | 0755 |
|
|
Templating | Folder | 0755 |
|
|
Tests | Folder | 0755 |
|
|
.gitignore | File | 39 B | 0644 |
|
.scrutinizer.yml | File | 114 B | 0644 |
|
.travis.yml | File | 1.23 KB | 0644 |
|
CHANGELOG.md | File | 68.76 KB | 0644 |
|
JMSSerializerBundle.php | File | 2.35 KB | 0644 |
|
LICENSE | File | 1.04 KB | 0644 |
|
META.md | File | 203 B | 0644 |
|
README.md | File | 960 B | 0644 |
|
UPGRADING.md | File | 3.61 KB | 0644 |
|
composer.json | File | 1.63 KB | 0644 |
|
phpunit.xml.dist | File | 1018 B | 0644 |
|