original_string: private function loadClients(array $clients, ContainerBuilder $container)
      {
          foreach ($clients as $name => $clientConfig) {
              $clientId = sprintf('phlexible_elastica.client.%s', $name);
              $clientDef = new DefinitionDecorator('phlexible_elastica.client_prototype');
              $clientDef->replaceArgument(0, $clientConfig);
              $logger = $clientConfig['connections'][0]['logger'];
              if (false !== $logger) {
                  $clientDef->addMethodCall('setLogger', array(new Reference($logger)));
              }
              $clientDef->addTag('phlexible_elastica.client');
              $container->setDefinition($clientId, $clientDef);
              $this->clients[$name] = array(
                  'id' => $clientId,
                  'reference' => new Reference($clientId),
              );
          }
      }
code: private function loadClients(array $clients, ContainerBuilder $container)
      {
          foreach ($clients as $name => $clientConfig) {
              $clientId = sprintf('phlexible_elastica.client.%s', $name);
              $clientDef = new DefinitionDecorator('phlexible_elastica.client_prototype');
              $clientDef->replaceArgument(0, $clientConfig);
              $logger = $clientConfig['connections'][0]['logger'];
              if (false !== $logger) {
                  $clientDef->addMethodCall('setLogger', array(new Reference($logger)));
              }
              $clientDef->addTag('phlexible_elastica.client');
              $container->setDefinition($clientId, $clientDef);
              $this->clients[$name] = array(
                  'id' => $clientId,
                  'reference' => new Reference($clientId),
              );
          }
      }
code_tokens: private function loadClients ( array $ clients , ContainerBuilder $ container ) { foreach ( $ clients as $ name => $ clientConfig ) { $ clientId = sprintf ( 'phlexible_elastica.client.%s' , $ name ) ; $ clientDef = new DefinitionDecorator ( 'phlexible_elastica.client_prototype' ) ; $ clientDef -> replaceArgument ( 0 , $ clientConfig ) ; $ logger = $ clientConfig [ 'connections' ] [ 0 ] [ 'logger' ] ; if ( false !== $ logger ) { $ clientDef -> addMethodCall ( 'setLogger' , array ( new Reference ( $ logger ) ) ) ; } $ clientDef -> addTag ( 'phlexible_elastica.client' ) ; $ container -> setDefinition ( $ clientId , $ clientDef ) ; $ this -> clients [ $ name ] = array ( 'id' => $ clientId , 'reference' => new Reference ( $ clientId ) , ) ; } }
docstring: Loads the configured clients.
  
  @param array            $clients   An array of clients configurations
  @param ContainerBuilder $container A ContainerBuilder instance
  
  @return array
docstring_tokens: Loads the configured clients .