original_string: protected function addProvider(ContainerBuilder $container, $dir, $bundle)
      {
          if ($container->hasDefinition('integrated_solr.converter.config.provider.file.' . $bundle)) {
              return null;
          }
  
          // If the bundle got a config/solr directory then a provider is created for this bundle. This
          // however still does not mean that the bundle actually got any solr config files but that is
          // not really a problem.
  
          if (!is_dir($dir . '/Resources/config/solr')) {
              return null;
          }
  
          $definition = new Definition(XmlProvider::class);
          $definition->setPublic(false);
          $definition->setArguments([$this->addFinder($container, $dir . '/Resources/config/solr', $bundle)]);
  
          $container->setDefinition('integrated_solr.converter.config.provider.file.' . $bundle, $definition);
  
          return new Reference('integrated_solr.converter.config.provider.file.' . $bundle);
      }
code: protected function addProvider(ContainerBuilder $container, $dir, $bundle)
      {
          if ($container->hasDefinition('integrated_solr.converter.config.provider.file.' . $bundle)) {
              return null;
          }
  
          // If the bundle got a config/solr directory then a provider is created for this bundle. This
          // however still does not mean that the bundle actually got any solr config files but that is
          // not really a problem.
  
          if (!is_dir($dir . '/Resources/config/solr')) {
              return null;
          }
  
          $definition = new Definition(XmlProvider::class);
          $definition->setPublic(false);
          $definition->setArguments([$this->addFinder($container, $dir . '/Resources/config/solr', $bundle)]);
  
          $container->setDefinition('integrated_solr.converter.config.provider.file.' . $bundle, $definition);
  
          return new Reference('integrated_solr.converter.config.provider.file.' . $bundle);
      }
code_tokens: protected function addProvider ( ContainerBuilder $ container , $ dir , $ bundle ) { if ( $ container -> hasDefinition ( 'integrated_solr.converter.config.provider.file.' . $ bundle ) ) { return null ; } // If the bundle got a config/solr directory then a provider is created for this bundle. This // however still does not mean that the bundle actually got any solr config files but that is // not really a problem. if ( ! is_dir ( $ dir . '/Resources/config/solr' ) ) { return null ; } $ definition = new Definition ( XmlProvider :: class ) ; $ definition -> setPublic ( false ) ; $ definition -> setArguments ( [ $ this -> addFinder ( $ container , $ dir . '/Resources/config/solr' , $ bundle ) ] ) ; $ container -> setDefinition ( 'integrated_solr.converter.config.provider.file.' . $ bundle , $ definition ) ; return new Reference ( 'integrated_solr.converter.config.provider.file.' . $ bundle ) ; }
docstring: Create a provider definition.
  
  Create the definition of a file provider instance if there is a possibility that this given bundle
  got any solr config files. But only if the container does not already contain a service definition
  with the same name.
  
  @param ContainerBuilder $container
  @param string           $dir
  @param string           $bundle
  
  @return null | Reference
docstring_tokens: Create a provider definition .