Exemple #1
0
 /**
  * Returns the writer wich gets used if no writer was explicit selected
  *
  * @return \PSX\Data\WriterInterface
  */
 private function getPreferredWriter()
 {
     $parameters = $this->request->getUri()->getParameters();
     $format = isset($parameters['format']) ? $parameters['format'] : null;
     if (!empty($format)) {
         return $this->writerFactory->getWriterByFormat($format, $this->getSupportedWriter());
     } else {
         return $this->writerFactory->getWriterByContentType($this->request->getHeader('Accept'), $this->getSupportedWriter());
     }
 }