@@ -7,7 +7,6 @@ |
||
| 7 | 7 | use Badger\TagBundle\Taggable\TaggableInterface; |
| 8 | 8 | use Badger\UserBundle\Entity\UserInterface; |
| 9 | 9 | use Doctrine\DBAL\Connection; |
| 10 | -use Doctrine\ORM\Query; |
|
| 11 | 10 | use Doctrine\ORM\EntityRepository; |
| 12 | 11 | |
| 13 | 12 | /** |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | use Symfony\Component\HttpFoundation\RedirectResponse; |
| 7 | 7 | use Symfony\Component\HttpFoundation\Request; |
| 8 | 8 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
| 9 | - |
|
| 10 | 9 | use Badger\TagBundle\Entity\Tag; |
| 11 | 10 | use Badger\TagBundle\Form\TagType; |
| 12 | 11 | use Symfony\Component\HttpFoundation\Response; |
@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use Symfony\Component\HttpKernel\Bundle\Bundle; |
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | - |
|
| 9 | 8 | * @license http://opensource.org/licenses/MIT The MIT License (MIT) |
| 10 | 9 | */ |
| 11 | 10 | class GateBundle extends Bundle |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $promise = $client->sendAsync($request, ['timeout' => 10]); |
| 50 | 50 | |
| 51 | 51 | $promise->then( |
| 52 | - function (ResponseInterface $res) use ($data) { |
|
| 52 | + function(ResponseInterface $res) use ($data) { |
|
| 53 | 53 | $this->logger->info( |
| 54 | 54 | sprintf( |
| 55 | 55 | 'Request to SLACK webhook OK [%s] with data: %s', |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | ) |
| 59 | 59 | ); |
| 60 | 60 | }, |
| 61 | - function (RequestException $e) { |
|
| 61 | + function(RequestException $e) { |
|
| 62 | 62 | $this->logger->error( |
| 63 | 63 | sprintf( |
| 64 | 64 | 'Request to SLACK webhook FAILED with message: %s', |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | $adventureStepCompletion = $adventureStepCompletionRepo->findOneBy(['pending' => 1])->getId(); |
| 21 | 21 | $client->request('GET', sprintf('admin/claimed-adventure-step/%s/reject', $adventureStepCompletion)); |
| 22 | 22 | |
| 23 | - $this->assertCount($count-=1, $adventureStepCompletionRepo->findAll(), 'Adventure step has been rejected and deleted'); |
|
| 23 | + $this->assertCount($count -= 1, $adventureStepCompletionRepo->findAll(), 'Adventure step has been rejected and deleted'); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | public function testAcceptAction() |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | $countAccepted = count($adventureStepCompletionRepo->findBy(['pending' => 0])); |
| 34 | 34 | $client->request('GET', sprintf('admin/claimed-adventure-step/%s/accept', current($adventureStepCompletions)->getId())); |
| 35 | 35 | |
| 36 | - $this->assertCount($countPending-=1, $adventureStepCompletionRepo->findBy(['pending' => 1]), 'Adventure step has been accepted'); |
|
| 37 | - $this->assertCount($countAccepted+=1, $adventureStepCompletionRepo->findBy(['pending' => 0]), 'Adventure step has been accepted'); |
|
| 36 | + $this->assertCount($countPending -= 1, $adventureStepCompletionRepo->findBy(['pending' => 1]), 'Adventure step has been accepted'); |
|
| 37 | + $this->assertCount($countAccepted += 1, $adventureStepCompletionRepo->findBy(['pending' => 0]), 'Adventure step has been accepted'); |
|
| 38 | 38 | } |
| 39 | 39 | } |
@@ -68,8 +68,8 @@ discard block |
||
| 68 | 68 | ] |
| 69 | 69 | ]); |
| 70 | 70 | |
| 71 | - $this->assertCount($adventureCount+=1, $this->adventureRepository->findAll()); |
|
| 72 | - $this->assertCount($adventureStepsCount+=2, $this->adventureStepRepository->findAll()); |
|
| 71 | + $this->assertCount($adventureCount += 1, $this->adventureRepository->findAll()); |
|
| 72 | + $this->assertCount($adventureStepsCount += 2, $this->adventureStepRepository->findAll()); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | public function testContraintsFormAction() |
@@ -108,9 +108,9 @@ discard block |
||
| 108 | 108 | 'form' => [] |
| 109 | 109 | ]); |
| 110 | 110 | |
| 111 | - $this->assertCount($adventureCount-=1, $this->adventureRepository->findAll(), 'Adventure is removed'); |
|
| 112 | - $this->assertCount($adventureStepCount-=2, $this->adventureStepRepository->findAll(), 'Steps of adventure are removed'); |
|
| 113 | - $this->assertCount($adventureComplRepoCount-=1, $this->adventureComplRepo->findAll(), 'Completions steps of adventure are removed'); |
|
| 111 | + $this->assertCount($adventureCount -= 1, $this->adventureRepository->findAll(), 'Adventure is removed'); |
|
| 112 | + $this->assertCount($adventureStepCount -= 2, $this->adventureStepRepository->findAll(), 'Steps of adventure are removed'); |
|
| 113 | + $this->assertCount($adventureComplRepoCount -= 1, $this->adventureComplRepo->findAll(), 'Completions steps of adventure are removed'); |
|
| 114 | 114 | $this->assertCount($badgeCount, $this->badgeRepository->findAll(), 'Badge are not removed when an adventure is removed'); |
| 115 | 115 | } |
| 116 | 116 | |
@@ -144,8 +144,8 @@ discard block |
||
| 144 | 144 | ]); |
| 145 | 145 | |
| 146 | 146 | $this->assertCount($adventureCount, $this->adventureRepository->findAll(), 'No adventure added or removed'); |
| 147 | - $this->assertCount($adventureStepsCount-=1, $this->adventureStepRepository->findAll(), 'Step deleted'); |
|
| 148 | - $this->assertCount($adventureCompletionCount-=1, $this->adventureComplRepo->findAll(), 'Adventure Completion linked to deleted step is removed'); |
|
| 147 | + $this->assertCount($adventureStepsCount -= 1, $this->adventureStepRepository->findAll(), 'Step deleted'); |
|
| 148 | + $this->assertCount($adventureCompletionCount -= 1, $this->adventureComplRepo->findAll(), 'Adventure Completion linked to deleted step is removed'); |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | public function testDeleteWhenStepsAreLinkedToBadges() |
@@ -163,9 +163,9 @@ discard block |
||
| 163 | 163 | 'form' => [] |
| 164 | 164 | ]); |
| 165 | 165 | |
| 166 | - $this->assertCount($adventureCount-=1, $this->adventureRepository->findAll(), 'Adventure is removed'); |
|
| 167 | - $this->assertCount($adventureStepCount-=4, $this->adventureStepRepository->findAll(), 'Steps of adventure are removed'); |
|
| 168 | - $this->assertCount($adventureComplRepoCount-=2, $this->adventureComplRepo->findAll(), 'Completions steps of adventure are removed'); |
|
| 166 | + $this->assertCount($adventureCount -= 1, $this->adventureRepository->findAll(), 'Adventure is removed'); |
|
| 167 | + $this->assertCount($adventureStepCount -= 4, $this->adventureStepRepository->findAll(), 'Steps of adventure are removed'); |
|
| 168 | + $this->assertCount($adventureComplRepoCount -= 2, $this->adventureComplRepo->findAll(), 'Completions steps of adventure are removed'); |
|
| 169 | 169 | $this->assertCount($badgeCount, $this->badgeRepository->findAll(), 'Badge are not removed when an adventure is removed'); |
| 170 | 170 | } |
| 171 | 171 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | $badge = $this->get('badger.game.repository.badge')->findOneBy(['title' => 'Master Contributor']); |
| 33 | 33 | $this->deleteBadge($client, $badge->getId()); |
| 34 | 34 | |
| 35 | - $this->assertCount($count-=1, $this->get('badger.game.repository.badge')->findAll()); |
|
| 35 | + $this->assertCount($count -= 1, $this->get('badger.game.repository.badge')->findAll()); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | public function testDeleteWhenBadgeHasBeenClaimed() |
@@ -45,8 +45,8 @@ discard block |
||
| 45 | 45 | $badge = $this->get('badger.game.repository.badge')->findOneBy(['title' => 'Bug Hunter']); |
| 46 | 46 | $this->deleteBadge($client, $badge->getId()); |
| 47 | 47 | |
| 48 | - $this->assertCount($countBadge-=1, $this->get('badger.game.repository.badge')->findAll(), 'Badge is removed'); |
|
| 49 | - $this->assertCount($countClaimedBadge-=1, $this->get('badger.game.repository.claimed_badge')->findAll(), 'Claimed badge is removed'); |
|
| 48 | + $this->assertCount($countBadge -= 1, $this->get('badger.game.repository.badge')->findAll(), 'Badge is removed'); |
|
| 49 | + $this->assertCount($countClaimedBadge -= 1, $this->get('badger.game.repository.claimed_badge')->findAll(), 'Claimed badge is removed'); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | public function testDeleteWhenBadgeHasBeenUnlocked() |
@@ -59,8 +59,8 @@ discard block |
||
| 59 | 59 | $badge = $this->get('badger.game.repository.badge')->findOneBy(['title' => 'ASS Disruptor']); |
| 60 | 60 | $this->deleteBadge($client, $badge->getId()); |
| 61 | 61 | |
| 62 | - $this->assertCount($countBadge-=1, $this->get('badger.game.repository.badge')->findAll(), 'Badge is removed'); |
|
| 63 | - $this->assertCount($countUnlockedBadge-=1, $this->get('badger.game.repository.unlocked_badge')->findAll(), 'Unlocked badge is removed'); |
|
| 62 | + $this->assertCount($countBadge -= 1, $this->get('badger.game.repository.badge')->findAll(), 'Badge is removed'); |
|
| 63 | + $this->assertCount($countUnlockedBadge -= 1, $this->get('badger.game.repository.unlocked_badge')->findAll(), 'Unlocked badge is removed'); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | $this->get('badger.game.unlocker.badge')->unlockBadge($user, $badge); |
| 21 | 21 | |
| 22 | - $this->assertCount($count+=1, $this->get('badger.game.repository.unlocked_badge')->getUnlockedBadgeIdsByUser($user)); |
|
| 22 | + $this->assertCount($count += 1, $this->get('badger.game.repository.unlocked_badge')->getUnlockedBadgeIdsByUser($user)); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | public function testUnlockBadgeWhenUserHasAlreadyTheBadge() |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | $this->get('badger.game.unlocker.badge')->unlockBadgeFromClaim(current($claimedBadges)); |
| 46 | 46 | |
| 47 | - $this->assertCount($count-=1, $this->get('badger.game.repository.claimed_badge')->findAll(), 'Claimed badge has been removed'); |
|
| 48 | - $this->assertCount($countBadges+=1, $this->get('badger.game.repository.unlocked_badge')->getUnlockedBadgeIdsByUser($user), 'Badge has been added'); |
|
| 47 | + $this->assertCount($count -= 1, $this->get('badger.game.repository.claimed_badge')->findAll(), 'Claimed badge has been removed'); |
|
| 48 | + $this->assertCount($countBadges += 1, $this->get('badger.game.repository.unlocked_badge')->getUnlockedBadgeIdsByUser($user), 'Badge has been added'); |
|
| 49 | 49 | } |
| 50 | 50 | } |
@@ -181,7 +181,7 @@ |
||
| 181 | 181 | */ |
| 182 | 182 | public function getApprovedCompletionsCount() |
| 183 | 183 | { |
| 184 | - return $this->completions->filter(function ($completion) { |
|
| 184 | + return $this->completions->filter(function($completion) { |
|
| 185 | 185 | return !$completion->isPending(); |
| 186 | 186 | })->count(); |
| 187 | 187 | } |