Skip to content

WebSocket Server allow dependencies.php overrides like Http Server#7454

Open
kingIZZZY wants to merge 2 commits intohyperf:masterfrom
kingIZZZY:patch-2
Open

WebSocket Server allow dependencies.php overrides like Http Server#7454
kingIZZZY wants to merge 2 commits intohyperf:masterfrom
kingIZZZY:patch-2

Conversation

@kingIZZZY
Copy link
Copy Markdown
Contributor

Instead of hard-coded instantiating new CoreMiddleware
Do the same as Hyperf\HttpServer\Server
Use container make() so it can use overrides of custom CoreMiddleware from config/autoload/dependencies.php

@huangdijia
Copy link
Copy Markdown
Member

Code Review Summary

APPROVE - This is a solid improvement that increases consistency between WebSocket and HTTP servers.

Key Points:

  • Good: Simple, focused change following established HTTP server patterns
  • Good: Maintains backward compatibility while enabling DI overrides
  • Minor: Consider using container->make() instead of global make() helper for consistency
  • Missing: Test coverage for custom CoreMiddleware injection would be beneficial

The change successfully allows dependencies.php to override CoreMiddleware, matching HTTP server behavior. Ready to merge.

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.

2 participants