Skip to content

Commit 23545a0

Browse files
authored
Merge pull request #312 from binaryfire/fix-broadcast-facade
fix: add channel() method to BroadcastPoolProxy
2 parents 527a9fc + 8093950 commit 23545a0

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

src/broadcasting/src/BroadcastManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
use Pusher\Pusher;
3535

3636
/**
37-
* @mixin \Hypervel\Broadcasting\Contracts\Broadcaster
37+
* @mixin \Hypervel\Broadcasting\Broadcasters\Broadcaster
3838
*/
3939
class BroadcastManager implements BroadcastingFactoryContract
4040
{

src/broadcasting/src/BroadcastPoolProxy.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,21 @@
66

77
use Hyperf\HttpServer\Contract\RequestInterface;
88
use Hypervel\Broadcasting\Contracts\Broadcaster;
9+
use Hypervel\Broadcasting\Contracts\HasBroadcastChannel;
910
use Hypervel\ObjectPool\PoolProxy;
1011

1112
class BroadcastPoolProxy extends PoolProxy implements Broadcaster
1213
{
14+
/**
15+
* Register a channel authenticator.
16+
*/
17+
public function channel(HasBroadcastChannel|string $channel, callable|string $callback, array $options = []): static
18+
{
19+
$this->__call(__FUNCTION__, func_get_args());
20+
21+
return $this;
22+
}
23+
1324
public function auth(RequestInterface $request): mixed
1425
{
1526
return $this->__call(__FUNCTION__, func_get_args());

src/support/src/Facades/Broadcast.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,17 @@
3333
* @method static \Hypervel\Broadcasting\BroadcastManager removePoolable(string $driver)
3434
* @method static array getPoolables()
3535
* @method static \Hypervel\Broadcasting\BroadcastManager setPoolables(array $poolables)
36+
* @method static array|null resolveAuthenticatedUser(\Hyperf\HttpServer\Contract\RequestInterface $request)
37+
* @method static void resolveAuthenticatedUserUsing(\Closure $callback)
38+
* @method static \Hypervel\Broadcasting\Broadcasters\Broadcaster channel(\Hypervel\Broadcasting\Contracts\HasBroadcastChannel|string $channel, callable|string $callback, array $options = [])
39+
* @method static \Hypervel\Support\Collection getChannels()
40+
* @method static void flushChannels()
3641
* @method static mixed auth(\Hyperf\HttpServer\Contract\RequestInterface $request)
3742
* @method static mixed validAuthenticationResponse(\Hyperf\HttpServer\Contract\RequestInterface $request, mixed $result)
3843
* @method static void broadcast(array $channels, string $event, array $payload = [])
3944
*
4045
* @see \Hypervel\Broadcasting\BroadcastManager
41-
* @see \Hypervel\Broadcasting\Contracts\Broadcaster
46+
* @see \Hypervel\Broadcasting\Broadcasters\Broadcaster
4247
*/
4348
class Broadcast extends Facade
4449
{

0 commit comments

Comments
 (0)