| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function getDescription(): string |
||
| 16 | { |
||
| 17 | $typeDescription = $this->relation->getType()->getDescription(); |
||
| 18 | $toName = $this->relation->getOpponent()->getName(); |
||
| 19 | $fromName = $this->relation->getAlliance()->getName(); |
||
| 20 | |||
| 21 | if ($this->relation->getType() === AllianceRelationTypeEnum::VASSAL) { |
||
| 22 | if ($this->relation->getAlliance()->getId() === $this->alliance->getId()) { |
||
| 23 | return sprintf('Hat die Allianz %s als %s', $toName, $typeDescription); |
||
| 24 | } else { |
||
| 25 | return sprintf('Ist %s der Allianz %s', $typeDescription, $fromName); |
||
| 26 | } |
||
| 27 | } |
||
| 28 | |||
| 29 | if ($this->relation->getAlliance()->getId() === $this->alliance->getId()) { |
||
| 30 | return sprintf('%s mit %s', $typeDescription, $toName); |
||
| 31 | } else { |
||
| 32 | return sprintf('%s mit %s', $typeDescription, $fromName); |
||
| 33 | } |
||
| 46 |