This commit is contained in:
as2252258@163.com
2021-08-04 02:57:46 +08:00
parent b58ac08dd0
commit 9922f0ad60
+1 -21
View File
@@ -190,24 +190,6 @@ class Response extends HttpService
}
/**
* @param $context
* @return mixed
* @throws Exception
*/
private function parseData($context): mixed
{
if (!empty($context) && !is_string($context)) {
/** @var IFormatter $class */
$class = $this->_format_maps[$this->format] ?? HtmlFormatter::class;
$di = Snowflake::getDi()->get($class);
$context = $di->send($context)->getData();
}
return $context;
}
/**
* @param mixed $content
*/
@@ -231,11 +213,9 @@ class Response extends HttpService
return $this->endData;
}
/** @var IFormatter $class */
$class = $this->_format_maps[$this->format] ?? HtmlFormatter::class;
$di = Snowflake::getDi()->get($class);
return $di->send($this->endData)->getData();
return \di($class)->send($this->endData)->getData();
}