Total Complexity | 4 |
Total Lines | 22 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
8 | class WinTeam 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->getFirstTeamResult() !== $result->getSecondTeamResult() |
||
18 | && $result->getFirstTeamUserResult() !== $result->getSecondTeamUserResult() |
||
19 | ) { |
||
20 | $hasWinFirstTeam = $result->getFirstTeamResult() > $result->getSecondTeamResult(); |
||
21 | $hasUserWinFirstTeam = $result->getFirstTeamUserResult() > $result->getSecondTeamUserResult(); |
||
22 | $check = $hasWinFirstTeam === $hasUserWinFirstTeam; |
||
23 | } |
||
24 | return $check; |
||
25 | } |
||
26 | |||
27 | public function getScore(): int |
||
30 | } |
||
31 | |||
32 | } |