Conditions | 5 |
Paths | 5 |
Total Lines | 23 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | public function __construct(BroadcastNotifiableInterface $notifiable, ChannelInterface $channel, array $config) |
||
16 | { |
||
17 | $this->notifiable = $notifiable; |
||
18 | $this->channel = $channel; |
||
19 | $this->config = $config; |
||
20 | $this->channelName = $channel->channelName(); |
||
21 | |||
22 | switch ($this->channelName) { |
||
23 | case 'slack': |
||
24 | // Set the data for Slack Broadcasts |
||
25 | if (!empty($config['webhook'])) { |
||
26 | $notifiable->setSlackWebhook($config['webhook']); |
||
27 | } |
||
28 | break; |
||
29 | |||
30 | case 'pusher': |
||
31 | // Set data for pusher broadcasts |
||
32 | if (!empty($config['channel_name'])) { |
||
33 | $notifiable->setPusherChannel($config['channel_name']); |
||
34 | } |
||
35 | break; |
||
36 | } |
||
37 | } |
||
38 | |||
48 | } |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: