private function registerClass(ContainerBuilder $container, $className, array $tags, array $methods)
    {
        if ($container->has($className)) {
            return;
        }

        $definition = $container->register($className, $className);
        if (method_exists($definition, 'setAutowiredMethods')) {
            $definition->setAutowiredMethods($methods);
        } else {
            $definition->setAutowired(true);
        }

        // Inject the container if applicable
        if (is_a($className, ContainerAwareInterface::class, true)) {
            $definition->addMethodCall('setContainer', [new Reference('service_container')]);
        }

        foreach ($tags as $tagClassName => $classTags) {
            if (!is_a($className, $tagClassName, true)) {
                continue;
            }

            foreach ($classTags as $classTag) {
                $definition->addTag($classTag[0], $classTag[1]);
            }
        }
    }