The issue here is that `array_walk` pushes the item be ref but trim don't get arguments by ref - so this line does nothing!
the right line would be `$mediaTypes = array_map('trim', $mediaTypes);`