Exemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function parse(ServerRequestInterface $request)
 {
     if (null === $this->parser) {
         throw new \RuntimeException('Data parser not specified');
     }
     if (null === $this->queryType) {
         throw new \RuntimeException('Query type not specified');
     }
     return $this->parser->parseQueryParams($request->getQueryParams(), $this->queryType);
 }
Exemplo n.º 2
0
 /**
  * @inheritdoc
  */
 public function decode($content)
 {
     $data = $this->decodeJson($content);
     return null !== $this->contentType ? $this->parser->parseDocument($data, $this->contentType) : $data;
 }