Conditions | 3 |
Paths | 3 |
Total Lines | 26 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
28 | public function get($studio) |
||
29 | { |
||
30 | $results = new Collection; |
||
|
|||
31 | |||
32 | $client = new Client(); |
||
33 | |||
34 | $listeners = IcecastListeners::forMounts($this->mounts[$studio]); |
||
35 | foreach ($this->mounts[$studio] as $mount) |
||
36 | { |
||
37 | $response = $client->get($this->hostname . '/admin/listclients?mount=/'. $mount, [ |
||
38 | 'auth' => $this->credentials |
||
39 | ]); |
||
40 | $xml = simplexml_load_string($response->getBody())->source->listener; |
||
41 | foreach ($xml as $node) |
||
42 | { |
||
43 | $listener = new stdClass; |
||
44 | $listener->hostname = gethostbyaddr($node->IP); |
||
45 | $listener->minutesConnected = round($node->Connected / 60); |
||
46 | $listener->userAgent = $node->UserAgent; |
||
47 | $listener->mount = $mount; |
||
48 | $listeners->push($listener); |
||
49 | } |
||
50 | } |
||
51 | |||
52 | return $listeners; |
||
53 | } |
||
54 | } |
||
55 |
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.