mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-04 04:37:46 +08:00
Optimized
This commit is contained in:
parent
e1ee2760c2
commit
b22cf3f19a
@ -62,7 +62,7 @@ class CoreMiddleware extends HttpCoreMiddleware
|
||||
*
|
||||
* @return array|Arrayable|mixed|ResponseInterface|string
|
||||
*/
|
||||
protected function handleFound(array $routes, ServerRequestInterface $request)
|
||||
protected function handleFound(array $routes, ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
[$controller,] = $this->prepareHandler($routes[1]);
|
||||
if (! $this->container->has($controller)) {
|
||||
|
@ -39,8 +39,8 @@ class WebSocketExceptionHandler extends ExceptionHandler
|
||||
public function handle(Throwable $throwable, ResponseInterface $response)
|
||||
{
|
||||
$this->logger->warning($this->formatter->format($throwable));
|
||||
|
||||
return $response;
|
||||
$stream = new SwooleStream((string) $exception->getMessage());
|
||||
return $response->withBody($stream);
|
||||
}
|
||||
|
||||
public function isValid(Throwable $throwable): bool
|
||||
|
@ -39,7 +39,7 @@ class Security
|
||||
];
|
||||
}
|
||||
|
||||
public function sign(string $key)
|
||||
public function sign(string $key): string
|
||||
{
|
||||
return base64_encode(sha1(trim($key) . self::KEY, true));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user