public static function decodeData($data, $contentType = '', $decodeAsAssociative = false) { if (in_array($contentType, ['application/json', 'text/json'])) { return json_decode($data, $decodeAsAssociative); } return rawurldecode($data); }