@@ -54,39 +54,39 @@ |
||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * @param ProofRequest $proofRequest |
|
| 59 | - * @param LifecycleEventArgs $event |
|
| 60 | - * @throws ORMException |
|
| 61 | - * @throws OptimisticLockException |
|
| 62 | - */ |
|
| 57 | + /** |
|
| 58 | + * @param ProofRequest $proofRequest |
|
| 59 | + * @param LifecycleEventArgs $event |
|
| 60 | + * @throws ORMException |
|
| 61 | + * @throws OptimisticLockException |
|
| 62 | + */ |
|
| 63 | 63 | public function postUpdate(ProofRequest $proofRequest, LifecycleEventArgs $event): void |
| 64 | 64 | { |
| 65 | 65 | $em = $event->getObjectManager(); |
| 66 | 66 | $event = new ProofRequestEvent($proofRequest); |
| 67 | 67 | |
| 68 | 68 | if ($this->isAccepted()) { |
| 69 | - $proofRequest->getPlayerChart()->setStatus( |
|
| 69 | + $proofRequest->getPlayerChart()->setStatus( |
|
| 70 | 70 | $em->getReference(PlayerChartStatus::class, PlayerChartStatus::ID_STATUS_INVESTIGATION) |
| 71 | - ); |
|
| 71 | + ); |
|
| 72 | 72 | |
| 73 | - $proofRequest->setPlayerResponding($this->userProvider->getPlayer()); |
|
| 74 | - $proofRequest->setDateAcceptance(new DateTime()); |
|
| 75 | - $this->eventDispatcher->dispatch($event, VideoGamesRecordsCoreEvents::PROOF_REQUEST_ACCEPTED); |
|
| 73 | + $proofRequest->setPlayerResponding($this->userProvider->getPlayer()); |
|
| 74 | + $proofRequest->setDateAcceptance(new DateTime()); |
|
| 75 | + $this->eventDispatcher->dispatch($event, VideoGamesRecordsCoreEvents::PROOF_REQUEST_ACCEPTED); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | if ($this->isRefused()) { |
| 79 | - $proofRequest->getPlayerChart()->setStatus( |
|
| 79 | + $proofRequest->getPlayerChart()->setStatus( |
|
| 80 | 80 | $em->getReference(PlayerChartStatus::class, PlayerChartStatus::ID_STATUS_NORMAL) |
| 81 | - ); |
|
| 81 | + ); |
|
| 82 | 82 | |
| 83 | - $proofRequest->setPlayerResponding($this->userProvider->getPlayer()); |
|
| 84 | - $proofRequest->setDateAcceptance(new DateTime()); |
|
| 85 | - $this->eventDispatcher->dispatch($event, VideoGamesRecordsCoreEvents::PROOF_REQUEST_REFUSED); |
|
| 83 | + $proofRequest->setPlayerResponding($this->userProvider->getPlayer()); |
|
| 84 | + $proofRequest->setDateAcceptance(new DateTime()); |
|
| 85 | + $this->eventDispatcher->dispatch($event, VideoGamesRecordsCoreEvents::PROOF_REQUEST_REFUSED); |
|
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - private function isAccepted(): bool |
|
| 89 | + private function isAccepted(): bool |
|
| 90 | 90 | { |
| 91 | 91 | return array_key_exists('status', $this->changeSet) |
| 92 | 92 | && $this->changeSet['status'][0] === ProofRequestStatus::STATUS_IN_PROGRESS |