public static function createWithBuilder(
        HandlerBuilderInterface $builder,
        FormatterRegistryInterface $formatterRegistry,
        $debug = false
    ) {
        $handler = $builder->buildHandler();
        $docGenerator = new DocGenerator($builder->buildDocExtractor(), $formatterRegistry);

        return new static($handler, $docGenerator, $debug);
    }