Skip to content

更正 ResponseInterface 的类型定义#15

Closed
Hanmo123 wants to merge 1 commit intohyperf:masterfrom
Hanmo123:patch-1
Closed

更正 ResponseInterface 的类型定义#15
Hanmo123 wants to merge 1 commit intohyperf:masterfrom
Hanmo123:patch-1

Conversation

@Hanmo123
Copy link

@Hanmo123 Hanmo123 commented Nov 29, 2025

Hyperf\HttpServer\Response 继承了 \Psr\Http\Message\ResponseInterface:

image

但是用于注入 Hyperf\HttpServer\Response 的 Hyperf\HttpServer\Contract\ResponseInterface 没有继承 \Psr\Http\Message\ResponseInterface:

image

导致一些静态类型推断错误(代码实际可以运行):

image

根据文档,现给 Hyperf\HttpServer\Contract\ResponseInterface 加上继承语句,使注入前后类型保持一致

@github-actions
Copy link

Hi, this is a READ-ONLY repository, please submit your PR on the https://github.com/hyperf/hyperf repository.

This Pull Request will close automatically.

Thanks!

@github-actions github-actions bot closed this Nov 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant