original_string: private function getFinder($fileName, ContainerBuilder $container)
      {
          $finder       = (new Finder())->files()->name($fileName);
          $resourcesDir = 'Resources'.DIRECTORY_SEPARATOR.'config';
  
          if (self::$directoriesCache) {
              return $finder->in(self::$directoriesCache);
          }
  
          foreach ($container->getParameter('kernel.bundles') as $name => $pathToBundle) {
              try {
                  $reflector = new \ReflectionClass($pathToBundle);
              } catch (\ReflectionException $e) {
                  continue;
              }
  
              $fileName = $reflector->getFileName();
              $fileName = str_replace($name.'.php', $resourcesDir, $fileName);
  
              try {
                  $finder->in($fileName);
                  self::$directoriesCache[$name] = $fileName;
              } catch (\InvalidArgumentException $e) {
                  // remove invalid directories
                  unset(self::$directoriesCache[$name]);
              }
          }
  
          return $finder;
      }
code: private function getFinder($fileName, ContainerBuilder $container)
      {
          $finder       = (new Finder())->files()->name($fileName);
          $resourcesDir = 'Resources'.DIRECTORY_SEPARATOR.'config';
  
          if (self::$directoriesCache) {
              return $finder->in(self::$directoriesCache);
          }
  
          foreach ($container->getParameter('kernel.bundles') as $name => $pathToBundle) {
              try {
                  $reflector = new \ReflectionClass($pathToBundle);
              } catch (\ReflectionException $e) {
                  continue;
              }
  
              $fileName = $reflector->getFileName();
              $fileName = str_replace($name.'.php', $resourcesDir, $fileName);
  
              try {
                  $finder->in($fileName);
                  self::$directoriesCache[$name] = $fileName;
              } catch (\InvalidArgumentException $e) {
                  // remove invalid directories
                  unset(self::$directoriesCache[$name]);
              }
          }
  
          return $finder;
      }
code_tokens: private function getFinder ( $ fileName , ContainerBuilder $ container ) { $ finder = ( new Finder ( ) ) -> files ( ) -> name ( $ fileName ) ; $ resourcesDir = 'Resources' . DIRECTORY_SEPARATOR . 'config' ; if ( self :: $ directoriesCache ) { return $ finder -> in ( self :: $ directoriesCache ) ; } foreach ( $ container -> getParameter ( 'kernel.bundles' ) as $ name => $ pathToBundle ) { try { $ reflector = new \ ReflectionClass ( $ pathToBundle ) ; } catch ( \ ReflectionException $ e ) { continue ; } $ fileName = $ reflector -> getFileName ( ) ; $ fileName = str_replace ( $ name . '.php' , $ resourcesDir , $ fileName ) ; try { $ finder -> in ( $ fileName ) ; self :: $ directoriesCache [ $ name ] = $ fileName ; } catch ( \ InvalidArgumentException $ e ) { // remove invalid directories unset ( self :: $ directoriesCache [ $ name ] ) ; } } return $ finder ; }
docstring: Build and return finder
  
  @param string           $fileName
  @param ContainerBuilder $container
  
  @return Finder
docstring_tokens: Build and return finder