| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | 2 | public function addAndGetByPlayer(Player $player) |
|
| 21 | {
|
||
| 22 | 2 | foreach ($this->scorer as $scorer) {
|
|
| 23 | 2 | if ($scorer->getPlayer()->equals($player)) {
|
|
| 24 | 2 | return $scorer; |
|
| 25 | } |
||
| 26 | 2 | } |
|
| 27 | |||
| 28 | 2 | $scorer = new Scorer(); |
|
| 29 | 2 | $scorer->setPlayer($player); |
|
| 30 | 2 | $this->scorer[] = $scorer; |
|
| 31 | |||
| 32 | 2 | return $scorer; |
|
| 33 | } |
||
| 34 | |||
| 47 |