swooletw / laravel-swoole

High performance HTTP server based on Swoole. Speed up your Laravel or Lumen applications.
MIT License
4.03k stars 388 forks source link

Pusher::__construct type param #515

Closed frf closed 2 years ago

frf commented 2 years ago

https://github.com/swooletw/laravel-swoole/blob/43d08783089b13b87677c4fbf0734cc0dc8ade7a/src/Websocket/Pusher.php#L71

Argument 7 passed to SwooleTW\Http\Websocket\Pusher::__construct() must be of the type string or null, array given, called in /var/www/html/vendor/swooletw/laravel-swoole/src/Websocket/Pusher.php on line 96

src/Concerns/InteractsWithWebsocket.php

public function pushMessage($server, array $data) { $pusher = Pusher::make($data, $server); $pusher->push($this->payloadParser->encode( $pusher->getEvent(), $pusher->getMessage() )); }

protected function __construct( int $opcode, int $sender, array $descriptors, bool $broadcast, bool $assigned, string $event, ?string $message, //HERE $server )

the constructor is typed and the parser allows array but the construct is as string how can I pass array ?

Arkanius commented 2 years ago

Fixed in v2.12.1