Commit 7c98ef59 by Daniel Schmidt

Fixed type in JsonParser

parent 1026b9da
...@@ -35,7 +35,7 @@ class JsonParser implements RequestParserInterface ...@@ -35,7 +35,7 @@ class JsonParser implements RequestParserInterface
public function parse($rawBody) public function parse($rawBody)
{ {
try { try {
return Json::encode($rawBody, $this->asArray); return Json::decode($rawBody, $this->asArray);
} catch (InvalidParamException $e) { } catch (InvalidParamException $e) {
if ($this->throwException) { if ($this->throwException) {
throw $e; throw $e;
......
...@@ -15,9 +15,9 @@ namespace yii\web; ...@@ -15,9 +15,9 @@ namespace yii\web;
*/ */
interface RequestParserInterface interface RequestParserInterface
{ {
/** /**
* @param string $rawBody the raw HTTP request body * @param string $rawBody the raw HTTP request body
* @return array parameters parsed from the request body * @return array parameters parsed from the request body
*/ */
public function parse($rawBody); public function parse($rawBody);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment