Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | public function sendMessage($message) |
||
21 | { |
||
22 | foreach ($this->channels as $channel) { |
||
23 | $payload = $this->getPayload($message, $channel); |
||
24 | |||
25 | $ch = curl_init(); |
||
26 | |||
27 | curl_setopt($ch, \CURLOPT_URL, $this->webhookUrl); |
||
28 | |||
29 | curl_setopt($ch, \CURLOPT_POST, 1); |
||
30 | curl_setopt($ch, \CURLOPT_POSTFIELDS, 'payload=' .json_encode($payload)); |
||
31 | |||
32 | $result = curl_exec($ch); |
||
|
|||
33 | |||
34 | curl_close($ch); |
||
35 | } |
||
36 | } |
||
37 | |||
53 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.