| Total Complexity | 4 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 8 | class WinScoreRightDiff implements ScoreInterface |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @param Result $result |
||
| 12 | * @return bool |
||
| 13 | */ |
||
| 14 | public function check(Result $result): bool |
||
| 15 | { |
||
| 16 | $check = false; |
||
| 17 | if ($result->getFirstTeamUserResult() !== null && $result->getSecondTeamUserResult() !== null) { |
||
| 18 | $diffUserResult = $result->getFirstTeamUserResult() - $result->getSecondTeamUserResult(); |
||
| 19 | $diffGameResult = $result->getFirstTeamResult() - $result->getSecondTeamResult(); |
||
| 20 | $check = ($diffGameResult === $diffUserResult); |
||
| 21 | } |
||
| 22 | |||
| 23 | return $check; |
||
| 24 | } |
||
| 25 | |||
| 26 | public function getScore(): int |
||
| 29 | } |
||
| 30 | |||
| 32 | } |