Conditions | 2 |
Paths | 2 |
Total Lines | 26 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
10 | 2 | public function GetGroupSummary($group) |
|
11 | { |
||
12 | // Set up the api details |
||
13 | 2 | $this->method = 'memberslistxml'; |
|
14 | |||
15 | 2 | if (is_numeric($group)) { |
|
16 | 1 | $this->url = 'http://steamcommunity.com/gid/'; |
|
17 | } else { |
||
18 | 1 | $this->url = 'http://steamcommunity.com/groups/'; |
|
19 | } |
||
20 | |||
21 | 2 | $this->url = $this->url . $group; |
|
22 | |||
23 | // Set up the arguments |
||
24 | $arguments = [ |
||
25 | 2 | 'xml' => 1, |
|
26 | ]; |
||
27 | |||
28 | // Get the client |
||
29 | 2 | $client = $this->setUpXml($arguments); |
|
30 | |||
31 | // Clean up the games |
||
32 | 2 | $group = new GroupContainer($client); |
|
|
|||
33 | |||
34 | 2 | return $group; |
|
35 | } |
||
36 | } |
||
37 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: