| @@ 51-61 (lines=11) @@ | ||
| 48 | /** |
|
| 49 | * @return string |
|
| 50 | */ |
|
| 51 | public function getAvgSkill() |
|
| 52 | {
|
|
| 53 | $c = 0; |
|
| 54 | $tot = 0; |
|
| 55 | foreach ($this->roster as $player) {
|
|
| 56 | $tot += $player->skillAvg; |
|
| 57 | $c++; |
|
| 58 | } |
|
| 59 | ||
| 60 | return bcdiv($tot, $c, 2); |
|
| 61 | } |
|
| 62 | ||
| 63 | /** |
|
| 64 | * @return string |
|
| @@ 66-76 (lines=11) @@ | ||
| 63 | /** |
|
| 64 | * @return string |
|
| 65 | */ |
|
| 66 | public function getAvgAge() |
|
| 67 | {
|
|
| 68 | $c = 0; |
|
| 69 | $tot = 0; |
|
| 70 | foreach ($this->roster as $player) {
|
|
| 71 | $tot += $player->age; |
|
| 72 | $c++; |
|
| 73 | } |
|
| 74 | ||
| 75 | return bcdiv($tot, $c, 2); |
|
| 76 | } |
|
| 77 | ||
| 78 | /** |
|
| 79 | * @param $role |
|