/** * @return list($format, $mimeContentType) */ public function decideFormat(ServiceResponse $response, Request $request) { if ($response->getFormat() !== NULL) { $format = $response->getFormat(); } elseif ($request->accepts('application/json')) { $format = ServiceResponse::JSON; } else { $format = ServiceResponse::HTML; } return array($format, $this->getContentType($format)); }