src/http/request/BodyDecoder.php
public static function addDecoder(string $class, string ...$contentTypes)
    {
        $interface = decoder\DecoderInterface::class;
        if (!is_subclass_of($class, $interface)) {
            throw new \InvalidArgumentException(
                "invalid value provided for 'class'; ".
                "expecting the name of a class that implements '$interface'"
            );
        }

        foreach ($contentTypes as $type) {
            static::$decoders[$class] = $type;
        }
    }
public static function addDecoder(string $class, string ...$contentTypes)
    {
        $interface = decoder\DecoderInterface::class;
        if (!is_subclass_of($class, $interface)) {
            throw new \InvalidArgumentException(
                "invalid value provided for 'class'; ".
                "expecting the name of a class that implements '$interface'"
            );
        }

        foreach ($contentTypes as $type) {
            static::$decoders[$class] = $type;
        }
    }
public static function addDecoder ( string $ class , string ... $ contentTypes ) { $ interface = decoder \ DecoderInterface :: class ; if ( ! is_subclass_of ( $ class , $ interface ) ) { throw new \ InvalidArgumentException ( "invalid value provided for 'class'; " . "expecting the name of a class that implements '$interface'" ) ; } foreach ( $ contentTypes as $ type ) { static :: $ decoders [ $ class ] = $ type ; } }
Replace existing decoders, or add additional decoders

@param string $class The nme of the decoder class
@param string ...$contentTypes The content types the decoder can handle
Replace existing decoders or add additional decoders