src/Message/Server/BodyParser.php
public static function addParser($className, array $contentTypes)
    {
        if (! is_a($className, BodyParserInterface::class)) {
            throw new InvalidArgumentException(
                "Parser objects MUST implement the BodyParserInterface interface."
            );
        }

        $existing = isset(self::$parsers[$className])
            ? self::$parsers[$className]
            : [];
        array_unshift(
            self::$parsers[$className],
            array_merge($existing, $contentTypes)
        );
    }
public static function addParser($className, array $contentTypes)
    {
        if (! is_a($className, BodyParserInterface::class)) {
            throw new InvalidArgumentException(
                "Parser objects MUST implement the BodyParserInterface interface."
            );
        }

        $existing = isset(self::$parsers[$className])
            ? self::$parsers[$className]
            : [];
        array_unshift(
            self::$parsers[$className],
            array_merge($existing, $contentTypes)
        );
    }
Adds a body parser to parsers map

@param string $className
@param array  $contentTypes

@throws InvalidArgumentException if provided class does not implement BodyParserInterface