| Conditions | 4 |
| Paths | 6 |
| Total Lines | 22 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 16 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | 2 | public function getReady( |
|
| 20 | BattlePartyInterface $attackers, |
||
| 21 | BattlePartyInterface $defenders, |
||
| 22 | bool $isOneWay, |
||
| 23 | MessageCollectionInterface $messages |
||
| 24 | ): void { |
||
| 25 | 2 | foreach ($attackers->getActiveMembers() as $attacker) { |
|
| 26 | 2 | $message = new Message( |
|
| 27 | 2 | $attacker->get()->getUser()->getId(), |
|
| 28 | 2 | null, |
|
| 29 | 2 | $this->fightLib->ready($attacker)->getInformations() |
|
| 30 | 2 | ); |
|
| 31 | 2 | $messages->add($message); |
|
| 32 | } |
||
| 33 | 2 | if (!$isOneWay) { |
|
| 34 | 1 | foreach ($defenders->getActiveMembers() as $defender) { |
|
| 35 | 1 | $message = new Message( |
|
| 36 | 1 | $defender->get()->getUser()->getId(), |
|
| 37 | 1 | null, |
|
| 38 | 1 | $this->fightLib->ready($defender)->getInformations() |
|
| 39 | 1 | ); |
|
| 40 | 1 | $messages->add($message); |
|
| 41 | } |
||
| 45 |