private static function getParametersFromContentType(string $contentType): array
    {
        $parameters = array_merge(
            self::getParametersFromGlobal($_GET),
            self::getParametersFromGlobal($_POST),
            self::getParametersFromGlobal($_FILES));
        $paramsSource = [];
        $rawInput = file_get_contents('php://input');
        switch ($contentType) {
            case ContentType::JSON:
                $paramsSource = (array) json_decode($rawInput);
                break;
            case ContentType::XML:
            case ContentType::XML_APP:
                $xml = new \SimpleXMLElement($rawInput);
                $paramsSource = (array) $xml;
                break;
            default:
                parse_str($rawInput, $paramsSource);
        }
        return array_merge($parameters, self::getParametersFromGlobal($paramsSource));
    }
private static function getParametersFromContentType(string $contentType): array
    {
        $parameters = array_merge(
            self::getParametersFromGlobal($_GET),
            self::getParametersFromGlobal($_POST),
            self::getParametersFromGlobal($_FILES));
        $paramsSource = [];
        $rawInput = file_get_contents('php://input');
        switch ($contentType) {
            case ContentType::JSON:
                $paramsSource = (array) json_decode($rawInput);
                break;
            case ContentType::XML:
            case ContentType::XML_APP:
                $xml = new \SimpleXMLElement($rawInput);
                $paramsSource = (array) $xml;
                break;
            default:
                parse_str($rawInput, $paramsSource);
        }
        return array_merge($parameters, self::getParametersFromGlobal($paramsSource));
    }
private static function getParametersFromContentType ( string $ contentType ) : array { $ parameters = array_merge ( self :: getParametersFromGlobal ( $ _GET ) , self :: getParametersFromGlobal ( $ _POST ) , self :: getParametersFromGlobal ( $ _FILES ) ) ; $ paramsSource = [ ] ; $ rawInput = file_get_contents ( 'php://input' ) ; switch ( $ contentType ) { case ContentType :: JSON : $ paramsSource = ( array ) json_decode ( $ rawInput ) ; break ; case ContentType :: XML : case ContentType :: XML_APP : $ xml = new \ SimpleXMLElement ( $ rawInput ) ; $ paramsSource = ( array ) $ xml ; break ; default : parse_str ( $ rawInput , $ paramsSource ) ; } return array_merge ( $ parameters , self :: getParametersFromGlobal ( $ paramsSource ) ) ; }
Load every request parameters depending on the request content type and
ensure to properly convert raw data to array parameters.

@return array
Load every request parameters depending on the request content type and ensure to properly convert raw data to array parameters .