| Conditions | 2 |
| Paths | 2 |
| Total Lines | 26 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | public function GetGroupSummary($group) |
||
| 11 | { |
||
| 12 | // Set up the api details |
||
| 13 | $this->method = 'memberslistxml'; |
||
| 14 | |||
| 15 | if (is_numeric($group)) { |
||
| 16 | $this->url = 'http://steamcommunity.com/gid/'; |
||
| 17 | } else { |
||
| 18 | $this->url = 'http://steamcommunity.com/groups/'; |
||
| 19 | } |
||
| 20 | |||
| 21 | $this->url = $this->url . $group; |
||
| 22 | |||
| 23 | // Set up the arguments |
||
| 24 | $arguments = [ |
||
| 25 | 'xml' => 1, |
||
| 26 | ]; |
||
| 27 | |||
| 28 | // Get the client |
||
| 29 | $client = $this->setUpXml($arguments); |
||
| 30 | |||
| 31 | // Clean up the games |
||
| 32 | $group = new GroupContainer($client); |
||
|
|
|||
| 33 | |||
| 34 | 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: