Skip to content

Conversation

@binaryfire
Copy link
Contributor

The Broadcast::channel() method was not exposed in the Broadcaster contract, causing static analysis tools to report it as undefined when using the Broadcast facade.

  • Add channel() to Broadcaster contract interface
  • Add channel() implementation to BroadcastPoolProxy
  • Regenerate Broadcast facade annotations using facade documenter

The Broadcast::channel() method was not exposed in the Broadcaster
contract, causing static analysis tools to report it as undefined
when using the Broadcast facade.

- Add channel() to Broadcaster contract interface
- Add channel() implementation to BroadcastPoolProxy
- Add @method annotation to Broadcast facade
@albertcht
Copy link
Member

albertcht commented Jan 2, 2026

Hi @binaryfire, do we just need to simply change the class reference from \Hypervel\Broadcasting\Contracts\Broadcaster to \Hypervel\Broadcasting\Broadcasters\Broadcasters instead of adding channel implementation in the interface like in Laravel?

Follow Laravel's pattern - the Broadcaster contract doesn't include
channel(), only the concrete Broadcasters\Broadcaster class does.

- Change @mixin and @see to reference Broadcasters\Broadcaster
- Revert channel() addition to Contracts\Broadcaster
- Keep BroadcastPoolProxy::channel() for pool return-value safety
- Regenerate facade annotations
@binaryfire
Copy link
Contributor Author

Hi @albertcht. You're right - I've updated the PR to follow Laravel's pattern. I've changed the @mixin and @see annotations to reference Broadcasters\Broadcaster instead of the contract, and reverted the interface change. The facade documenter now picks up channel(), getChannels(), flushChannels() etc. from the concrete class.

I kept the explicit channel() on BroadcastPoolProxy though - I think it's needed for pool safety? Without it, __call() would return the underlying broadcaster (which gets immediately released back to the pool), breaking method chaining. The explicit method returns $this (the proxy) instead.

@albertcht
Copy link
Member

Hi @albertcht. You're right - I've updated the PR to follow Laravel's pattern. I've changed the @mixin and @see annotations to reference Broadcasters\Broadcaster instead of the contract, and reverted the interface change. The facade documenter now picks up channel(), getChannels(), flushChannels() etc. from the concrete class.

I kept the explicit channel() on BroadcastPoolProxy though - I think it's needed for pool safety? Without it, __call() would return the underlying broadcaster (which gets immediately released back to the pool), breaking method chaining. The explicit method returns $this (the proxy) instead.

Thank you so much! Yes, I think we should keep channel() on BroadcastPoolProxy.

@albertcht albertcht changed the title fix: add channel() method to Broadcaster contract fix: add channel() method to BroadcastPoolProxy Jan 2, 2026
@albertcht albertcht added the bug Something isn't working label Jan 2, 2026
@albertcht albertcht merged commit 23545a0 into hypervel:main Jan 2, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants