Fixed type in JsonParser

This commit is contained in:
Daniel Schmidt
2014-01-19 14:51:16 -08:00
parent 1026b9da57
commit 7c98ef591c
2 changed files with 5 additions and 5 deletions

View File

@ -35,7 +35,7 @@ class JsonParser implements RequestParserInterface
public function parse($rawBody)
{
try {
return Json::encode($rawBody, $this->asArray);
return Json::decode($rawBody, $this->asArray);
} catch (InvalidParamException $e) {
if ($this->throwException) {
throw $e;

View File

@ -15,9 +15,9 @@ namespace yii\web;
*/
interface RequestParserInterface
{
/**
* @param string $rawBody the raw HTTP request body
* @return array parameters parsed from the request body
*/
/**
* @param string $rawBody the raw HTTP request body
* @return array parameters parsed from the request body
*/
public function parse($rawBody);
}