CoC_Member::getDonationsReceived()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
class CoC_Member
4
{
5
	protected $memberObj;
6
7
	/**
8
	 * Constructor of CoC_Member
9
	 * 
10
	 * @param $memberObj, obtained by Clan.class.php
11
	 */
12
	public function __construct($memberObj)
13
	{
14
		$this->memberObj = $memberObj;
15
	}
16
	
17
	/**
18
	 * Gets the members tag (id)
19
	 *
20
	 * @return string, tag
0 ignored issues
show
Documentation introduced by
The doc-type string, could not be parsed: Expected "|" or "end of type", but got "," at position 6. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
21
	 */
22
	public function getTag()
23
	{
24
		return $this->memberObj->tag;
25
	}
26
27
	/**
28
	 * Gets the members name
29
	 *
30
	 * @return string, name
0 ignored issues
show
Documentation introduced by
The doc-type string, could not be parsed: Expected "|" or "end of type", but got "," at position 6. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
31
	 */
32
	public function getName()
33
	{
34
		return $this->memberObj->name;
35
	}
36
37
	/**
38
	 * Gets the members role ("member", "admin", "coLeader", "leader")
39
	 *
40
	 * @return string, role
0 ignored issues
show
Documentation introduced by
The doc-type string, could not be parsed: Expected "|" or "end of type", but got "," at position 6. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
41
	 */
42
	public function getRole()
43
	{
44
		return $this->memberObj->role;
45
	}
46
47
	/**
48
	 * Gets the members level
49
	 *
50
	 * @return int, level
0 ignored issues
show
Documentation introduced by
The doc-type int, could not be parsed: Expected "|" or "end of type", but got "," at position 3. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
51
	 */
52
	public function getLevel()
53
	{
54
		return $this->memberObj->expLevel;
55
	}
56
57
	/**
58
	 * Gets the members league ID
59
	 *
60
	 * @return int, league ID
0 ignored issues
show
Documentation introduced by
The doc-type int, could not be parsed: Expected "|" or "end of type", but got "," at position 3. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
61
	 */
62
	public function getLeagueId()
63
	{
64
		return $this->memberObj->league->id;
65
	}
66
67
	/**
68
	 * Gets the members league
69
 	 *
70
 	 * @return stdClass
71
 	 */
72
	public function getLeague()
73
	{
74
		return $this->memberObj->league;
75
	}
76
77
	/**
78
	 * Gets the members trophy-count
79
	 *
80
	 * @return int, trophies
0 ignored issues
show
Documentation introduced by
The doc-type int, could not be parsed: Expected "|" or "end of type", but got "," at position 3. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
81
	 */
82
	public function getTrophies()
83
	{
84
		return $this->memberObj->trophies;
85
	}
86
87
	/**
88
	 * Gets the members rank inside the clan-ranklist
89
	 *
90
	 * @return int, rank
0 ignored issues
show
Documentation introduced by
The doc-type int, could not be parsed: Expected "|" or "end of type", but got "," at position 3. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
91
	 */
92
	public function getClanRank()
93
	{
94
		return $this->memberObj->clanRank;
95
	}
96
97
	/**
98
	 * Gets the members previous rank inside the clan-ranklist
99
	 *
100
	 * @return int, rank
0 ignored issues
show
Documentation introduced by
The doc-type int, could not be parsed: Expected "|" or "end of type", but got "," at position 3. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
101
	 */
102
	public function getPreviousClanRank()
103
	{
104
		return $this->memberObj->previousClanRank;
105
	}
106
107
	/**
108
	 * Gets the amount of donations done by the member
109
	 *
110
	 * @return int, donations
0 ignored issues
show
Documentation introduced by
The doc-type int, could not be parsed: Expected "|" or "end of type", but got "," at position 3. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
111
	 */
112
	public function getDonations()
113
	{
114
		return $this->memberObj->donations;
115
	}
116
117
	/**
118
	 * Gets the amount of donations received by the member
119
	 *
120
	 * @return int, donations
0 ignored issues
show
Documentation introduced by
The doc-type int, could not be parsed: Expected "|" or "end of type", but got "," at position 3. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
121
	 */
122
	public function getDonationsReceived()
123
	{
124
		return $this->memberObj->donationsReceived;
125
	}
126
	
127
		/**
128
	 * Gets the donation ratio of the member
129
	 *
130
	 * @return int, ratio
0 ignored issues
show
Documentation introduced by
The doc-type int, could not be parsed: Expected "|" or "end of type", but got "," at position 3. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
131
	 */
132
	public function getDonationsRatio()
133
	{
134
		return round($this->memberObj->donations / (float) max($this->memberObj->donationsReceived, 1), 2);
135
	}
136
}
137
138
?>
0 ignored issues
show
Best Practice introduced by
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...
139