Añade un converter

@param callable $converter
@param string   ...$types

@return \PlanB\DS\BuilderInterface
19723
public function converter(callable $converter, string ...$types): BuilderInterface
    {
        $this->resolver->converter($converter, ...$types);

        return $this;
    }
490508
public function addConverters(array $converters) {
        foreach ($converters as $converter) {
            if (is_string($converter)) {
                $converter = new $converter();
            }

            if (!$converter instanceof OutputConverterInterface) {
                $name = is_object($converter) ? get_class($converter) : (string) $converter;
                throw new InvalidArgumentException('Given converter (' . $name . ') does not implement OutputConverterInterface', 500);
            }

            $this->registerConverter($converter);
        }

        return $this;
    }
158700
public static <E> void registerTypeConverter(Class<E> cls, TypeConverter<E> converter) {
        TYPE_CONVERTERS.put(cls, converter);
    }
861457
protected function setDateFromConverter(Converter $converter)
    {
        $this->year = $converter->getYear();
        $this->month = $converter->getMonth();
        $this->day = $converter->getDay();
    }
469648
public <FT> CsvProcessor<T> withConverter(Class<FT> clazz, Converter<FT, ?> converter) {
		converterMap.put(clazz, converter);
		return this;
	}
1121570
public static <U, V> Converter<V, U> wrapWithCast(
      Converter<Object, U> converter, Class<V> type) {
    Converter<V, Object> castConverter = new CastingConverter<V>(type).inverse();
    return castConverter.compose(converter);
  }
11389
protected function configureConverterFromInputOptions($converter, $input)
    {
        if (!$converter instanceof ToLatexInterface) {
            throw new \InvalidArgumentException(
                'The converter used to process '
                . $input->getOption('input-format') . ' should implement the '
                . 'phpDocumentor\Plugin\Scrybe\Converter\ToPdfInterface'
            );
        }

        $converter->setTitle($input->getOption('title'));
        $converter->setAuthor($input->getOption('author'));
        $converter->setCoverLogo($input->getOption('cover-logo'));
        $converter->setTableOfContents($input->getOption('toc') !== 'false');
    }
374967
public function transformNumbersBySplittingIntoPowerAwareTriplets(
        NumberToTripletsConverter $numberToTripletsConverter,
        PowerAwareTripletTransformer $powerAwareTripletTransformer
    ) {
        $this->numberTransformer->setNumberToTripletsConverter($numberToTripletsConverter);
        $this->numberTransformer->setPowerAwareTripletTransformer($powerAwareTripletTransformer);

        return $this;
    }
1337588
public function getTransformer(?array $sourcesTypes, ?array $targetTypes, MapperConfigurationInterface $mapperConfiguration): ?TransformerInterface
    {
        foreach ($this->factories as $factory) {
            $transformer = $factory->getTransformer($sourcesTypes, $targetTypes, $mapperConfiguration);

            if ($transformer !== null) {
                return $transformer;
            }
        }

        return null;
    }
213494
protected function addConvertor(AbstractConvertor $convertor)
	{
		foreach ($convertor->getRegexpGroups() as $name => $group)
		{
			$this->matchGroup[$name] = $group;
			$this->groups[$group][]  = '(?&' . $name . ')';
		}

		foreach ($convertor->getRegexps() as $name => $regexp)
		{
			$regexp = $this->insertCaptureNames($name, $regexp);
			$regexp = str_replace(' ', '\\s*', $regexp);
			$regexp = '(?<' . $name . '>' . $regexp . ')';

			$this->callbacks[$name] = [$convertor, 'convert' . $name];
			$this->regexps[$name]   = $regexp;
		}
	}
1372083
public function registerConverter(OutputConverterInterface $converter) {
        foreach ($converter->getSupportedMimeTypes() as $mimeType => $extensions) {
            if (!is_array($extensions)) {
                $extensions = [$extensions];
            }

            if (!isset($this->convertersByMimeType[$mimeType])) {
                $this->convertersByMimeType[$mimeType] = [];
            }

            if (!isset($this->mimeTypeToExtension[$mimeType])) {
                $this->mimeTypeToExtension[$mimeType] = $extensions[0];
            }

            $this->convertersByMimeType[$mimeType][] = $converter;

            foreach ($extensions as $extension) {
                if (!isset($this->convertersByExtension[$extension])) {
                    $this->convertersByExtension[$extension] = [];
                }

                if (!isset($this->extensionToMimeType[$extension])) {
                    $this->extensionToMimeType[$extension] = $mimeType;
                }

                $this->convertersByExtension[$extension][] = $converter;
            }
        }

        return $this;
    }
1257959
public void addConverter(Converter<?, ?> converter) {
		GenericConverter.ConvertiblePair typeInfo = getRequiredTypeInfo(converter, Converter.class);
		Assert.notNull(typeInfo, "Unable to the determine sourceType <S> and targetType " +
				"<T> which your Converter<S, T> converts between; declare these generic types.");
		addConverter(new ConverterAdapter(converter, typeInfo));
	}
904209
def add_type_converter(type, r2c, c2r)
      warn "WAR\NING: overridding #{type} on #{caller[0]}" if @@type_map.has_key? type
      @@type_map[type] = [r2c, c2r]
    end
1139460
public <T> void register(Class<T> type, Converter<T> converter) {
        addConverter(type, converter);
    }
526754
public function setTypeConverterFactory(TypeConverterFactory $factory): self
    {
        $this->converterFactory = $factory;
        $factory->setConnection($this);

        return $this;
    }
1273077
@SuppressWarnings("rawtypes")
    public void addConverter(Function<?, ?> converter) {

        LettuceAssert.notNull(converter, "Converter must not be null");

        ClassTypeInformation<? extends Function> classTypeInformation = ClassTypeInformation.from(converter.getClass());
        TypeInformation<?> typeInformation = classTypeInformation.getSuperTypeInformation(Function.class);
        List<TypeInformation<?>> typeArguments = typeInformation.getTypeArguments();

        ConvertiblePair pair = new ConvertiblePair(typeArguments.get(0).getType(), typeArguments.get(1).getType());
        converterMap.put(pair, converter);
    }
1291545
public function createClient($identifier)
    {
        if (!$this->converter_holder->hasType($identifier)) {
            throw new ConverterException(
                sprintf(
                    "No converter registered for type '%s'.",
                    $identifier
                )
            );
        }

        return new ConverterClient(
            $identifier,
            $this->converter_holder->getConverterForType($identifier)
        );
    }