Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SerializerPass.php

function SerializerPass::buildChildDefinitions

1 call to SerializerPass::buildChildDefinitions()
SerializerPass::configureNamedSerializers in vendor/symfony/serializer/DependencyInjection/SerializerPass.php

File

vendor/symfony/serializer/DependencyInjection/SerializerPass.php, line 181

Class

SerializerPass
Adds all services with the tags "serializer.encoder" and "serializer.normalizer" as encoders and normalizers to the "serializer" service.

Namespace

Symfony\Component\Serializer\DependencyInjection

Code

private function buildChildDefinitions(ContainerBuilder $container, string $serializerName, array $services, array $config) : array {
    foreach ($services as &$id) {
        $childId = $id . '.' . $serializerName;
        $definition = $container->registerChild($childId, (string) $id);
        if (null !== ($nameConverterIndex = $this->findNameConverterIndex($container, (string) $id))) {
            $definition->replaceArgument($nameConverterIndex, new Reference($config['name_converter']));
        }
        $id = new Reference($childId);
    }
    return $services;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal