| Total Complexity | 5 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | abstract class AbstractRankingQuery |
||
| 12 | { |
||
| 13 | protected EntityManagerInterface $em; |
||
| 14 | protected UserProvider $userProvider; |
||
| 15 | |||
| 16 | public function __construct( |
||
| 17 | EntityManagerInterface $em, |
||
| 18 | UserProvider $userProvider |
||
| 19 | ) { |
||
| 20 | $this->em = $em; |
||
| 21 | $this->userProvider = $userProvider; |
||
| 22 | } |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @throws ORMException |
||
| 26 | */ |
||
| 27 | protected function getPlayer(): ?Player |
||
| 28 | { |
||
| 29 | if ($this->userProvider->getUser()) { |
||
| 30 | return $this->userProvider->getPlayer(); |
||
| 31 | } |
||
| 32 | return null; |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @throws ORMException |
||
| 37 | */ |
||
| 38 | protected function getTeam(): ?Team |
||
| 44 | } |
||
| 45 | } |
||
| 46 |