protected function addFinder(ContainerBuilder $container, $dir, $bundle)
    {
        $ref = new Reference('integrated_solr.converter.config.provider.file.' . $bundle . '.finder');

        if ($container->hasDefinition('integrated_solr.converter.config.provider.file.' . $bundle . '.finder')) {
            return $ref;
        }

        $container->addResource(new FileResource($dir)); // not really sure what this does

        $definition = new Definition(Finder::class);
        $definition->setPublic(false);
        $definition->addMethodCall('in', [$dir]);

        $container->setDefinition('integrated_solr.converter.config.provider.file.' . $bundle . '.finder', $definition);

        return $ref;
    }