@@ -28,8 +28,7 @@ |
||
28 | 28 | EntityManagerInterface $em, |
29 | 29 | PlayerChartRankingQuery $playerChartRankingQuery, |
30 | 30 | EventDispatcherInterface $eventDispatcher |
31 | - ) |
|
32 | - { |
|
31 | + ) { |
|
33 | 32 | $this->em = $em; |
34 | 33 | $this->playerChartRankingQuery = $playerChartRankingQuery; |
35 | 34 | $this->eventDispatcher = $eventDispatcher; |
@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | class VideoCommentListener |
10 | 10 | { |
11 | - private UserProvider $userProvider; |
|
11 | + private UserProvider $userProvider; |
|
12 | 12 | |
13 | 13 | /** |
14 | 14 | * @param UserProvider $userProvider |
@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | class VideoListener |
10 | 10 | { |
11 | - private UserProvider $userProvider; |
|
11 | + private UserProvider $userProvider; |
|
12 | 12 | |
13 | 13 | /** |
14 | 14 | * @param UserProvider $userProvider |
@@ -40,12 +40,12 @@ |
||
40 | 40 | */ |
41 | 41 | private ?Video $video = null; |
42 | 42 | |
43 | - /** |
|
44 | - * @ORM\ManyToOne(targetEntity="VideoGamesRecords\CoreBundle\Entity\ProofRequest") |
|
45 | - * @ORM\JoinColumns({ |
|
46 | - * @ORM\JoinColumn(name="idProofRequest", referencedColumnName="id", nullable=true) |
|
47 | - * }) |
|
48 | - */ |
|
43 | + /** |
|
44 | + * @ORM\ManyToOne(targetEntity="VideoGamesRecords\CoreBundle\Entity\ProofRequest") |
|
45 | + * @ORM\JoinColumns({ |
|
46 | + * @ORM\JoinColumn(name="idProofRequest", referencedColumnName="id", nullable=true) |
|
47 | + * }) |
|
48 | + */ |
|
49 | 49 | private ?ProofRequest $proofRequest = null; |
50 | 50 | |
51 | 51 | /** |
@@ -55,35 +55,35 @@ |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | |
58 | - /** |
|
59 | - * @param ProofRequest $proofRequest |
|
60 | - * @param LifecycleEventArgs $event |
|
61 | - * @throws ORMException |
|
62 | - * @throws OptimisticLockException |
|
63 | - */ |
|
58 | + /** |
|
59 | + * @param ProofRequest $proofRequest |
|
60 | + * @param LifecycleEventArgs $event |
|
61 | + * @throws ORMException |
|
62 | + * @throws OptimisticLockException |
|
63 | + */ |
|
64 | 64 | public function postUpdate(ProofRequest $proofRequest, LifecycleEventArgs $event): void |
65 | 65 | { |
66 | 66 | $em = $event->getObjectManager(); |
67 | 67 | |
68 | 68 | $setPlayerResponding = false; |
69 | 69 | if (array_key_exists('status', $this->changeSet)) { |
70 | - $event = new ProofRequestEvent($proofRequest); |
|
71 | - if ($this->changeSet['status'][0] === ProofRequestStatus::STATUS_IN_PROGRESS && $this->changeSet['status'][1] === ProofRequestStatus::STATUS_ACCEPTED) { |
|
72 | - $proofRequest->getPlayerChart()->setStatus( |
|
70 | + $event = new ProofRequestEvent($proofRequest); |
|
71 | + if ($this->changeSet['status'][0] === ProofRequestStatus::STATUS_IN_PROGRESS && $this->changeSet['status'][1] === ProofRequestStatus::STATUS_ACCEPTED) { |
|
72 | + $proofRequest->getPlayerChart()->setStatus( |
|
73 | 73 | $em->getReference(PlayerChartStatus::class, PlayerChartStatus::ID_STATUS_INVESTIGATION) |
74 | - ); |
|
74 | + ); |
|
75 | 75 | |
76 | - $setPlayerResponding = true; |
|
77 | - $this->eventDispatcher->dispatch($event, VideoGamesRecordsCoreEvents::PROOF_REQUEST_ACCEPTED); |
|
78 | - } |
|
79 | - if ($this->changeSet['status'][0] === ProofRequestStatus::STATUS_IN_PROGRESS && $this->changeSet['status'][1] === ProofRequestStatus::STATUS_REFUSED) { |
|
80 | - $proofRequest->getPlayerChart()->setStatus( |
|
76 | + $setPlayerResponding = true; |
|
77 | + $this->eventDispatcher->dispatch($event, VideoGamesRecordsCoreEvents::PROOF_REQUEST_ACCEPTED); |
|
78 | + } |
|
79 | + if ($this->changeSet['status'][0] === ProofRequestStatus::STATUS_IN_PROGRESS && $this->changeSet['status'][1] === ProofRequestStatus::STATUS_REFUSED) { |
|
80 | + $proofRequest->getPlayerChart()->setStatus( |
|
81 | 81 | $em->getReference(PlayerChartStatus::class, PlayerChartStatus::ID_STATUS_NORMAL) |
82 | - ); |
|
82 | + ); |
|
83 | 83 | |
84 | - $setPlayerResponding = true; |
|
85 | - $this->eventDispatcher->dispatch($event, VideoGamesRecordsCoreEvents::PROOF_REQUEST_REFUSED); |
|
86 | - } |
|
84 | + $setPlayerResponding = true; |
|
85 | + $this->eventDispatcher->dispatch($event, VideoGamesRecordsCoreEvents::PROOF_REQUEST_REFUSED); |
|
86 | + } |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | if ($setPlayerResponding) { |