Completed
Push — Laravel4 ( 02d48b...8c5149 )
by Travis
03:47 queued 03:02
created

Group::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 13
rs 9.4285
cc 2
eloc 8
nc 2
nop 1
1
<?php namespace Syntax\SteamApi\Containers;
2
3
use Syntax\SteamApi\Client;
4
use Syntax\SteamApi\Collection;
5
use Syntax\SteamApi\Containers\Group\Details;
6
use Syntax\SteamApi\Containers\Group\MemberDetails;
7
8
class Group {
9
10
	public $groupID64;
11
12
	public $groupDetails;
13
14
	public $memberDetails;
15
16
	public $startingMember;
17
18
	public $members;
19
20
	/**
21
	 * @param \SimpleXMLElement $group
22
	 */
23
	function __construct($group)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
24
	{
25
		$this->groupID64      = (string)$group->groupID64;
26
		$this->groupDetails   = new Details($group->groupDetails);
27
		$this->memberDetails  = new MemberDetails($group->groupDetails);
28
		$this->startingMember = (int)(string)$group->startingMember;
29
30
		$this->members = new Collection;
31
32
		foreach ($group->members->steamID64 as $member) {
33
			$this->members->add((new Client)->convertId((int)(string)$member));
34
		}
35
	}
36
37
38
}