src/EventListener/AddFormatListener.php
private function addRequestFormats(Request $request, array $formats): void
    {
        foreach ($formats as $format => $mimeTypes) {
            $request->setFormat($format, (array) $mimeTypes);
        }
    }
private function addRequestFormats(Request $request, array $formats): void
    {
        foreach ($formats as $format => $mimeTypes) {
            $request->setFormat($format, (array) $mimeTypes);
        }
    }
private function addRequestFormats ( Request $ request , array $ formats ) : void { foreach ( $ formats as $ format => $ mimeTypes ) { $ request -> setFormat ( $ format , ( array ) $ mimeTypes ) ; } }
Adds the supported formats to the request.

This is necessary for {@see Request::getMimeType} and {@see Request::getMimeTypes} to work.
Adds the supported formats to the request .