public static function decode($string, $asArray = false)
{
$decoded = self::safeDecode($string, $asArray);
if (is_null($decoded) == false) {
return $decoded;
}
$code = self::lastError();
if ($code == JSON_ERROR_NONE) {
return $decoded;
}
throw new JsonDecodeException(self::lastErrorMessage(), $code);
}
public function handle($data) { $method = $data['method']; $restData = Json::decode($data['rest_data']); $class = '\\Tests\\MockSugarServer\\Action\\' . Strings::underscoreToCamelCase($method); $action = new $class($restData); return $action->process()->response(); }