1 | <?php |
||
2 | |||
3 | namespace MallardDuck\DynamicEcho\Channels; |
||
4 | |||
5 | use App\Models\User; |
||
0 ignored issues
–
show
|
|||
6 | use Illuminate\Http\Request; |
||
7 | use MallardDuck\DynamicEcho\Contracts\HasDynamicChannelFormula; |
||
8 | |||
9 | /** |
||
10 | * Class PrivateChannelParameters |
||
11 | * |
||
12 | * @mixin AbstractChannelParameters |
||
13 | */ |
||
14 | final class PrivateUserChannelParameters extends AbstractChannelParameters |
||
15 | { |
||
16 | 1 | public function __construct() |
|
17 | { |
||
18 | 1 | $this->channelType = \Illuminate\Broadcasting\PrivateChannel::class; |
|
19 | 1 | $this->channelAuthName = 'App.Models.User.{userId}'; |
|
20 | 1 | $this->channelAuthCallback = static function (User $user, $userId) { |
|
21 | return (int) $user->id === (int) $userId; |
||
22 | }; |
||
23 | 1 | $this->channelContextBindingCallback = static function (Request $request) { |
|
24 | return [ |
||
25 | 'userId' => $request->user()->id |
||
26 | ]; |
||
27 | }; |
||
28 | 1 | $this->eventChannelIdentifierBindingCallback = static function (HasDynamicChannelFormula $event) { |
|
29 | $self = $event; |
||
30 | return [ |
||
31 | 'userId' => $self->userId, |
||
0 ignored issues
–
show
|
|||
32 | ]; |
||
33 | }; |
||
34 | 1 | parent::__construct(); |
|
35 | 1 | } |
|
36 | } |
||
37 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths