@@ -110,7 +110,7 @@ |
||
| 110 | 110 | ); |
| 111 | 111 | |
| 112 | 112 | if ($mailSent) { |
| 113 | - $this->addFlashMessage(FlashMessageCategory::SUCCESS, "A validation mail has been sent to " . $user->getEmail()); |
|
| 113 | + $this->addFlashMessage(FlashMessageCategory::SUCCESS, "A validation mail has been sent to ".$user->getEmail()); |
|
| 114 | 114 | return; |
| 115 | 115 | } |
| 116 | 116 | |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | { |
| 17 | 17 | $trick = $event->getEntity(); |
| 18 | 18 | $this->deleteFromDatabase($event); |
| 19 | - $this->addFlashMessage(FlashMessageCategory::SUCCESS, 'Trick ' . $trick->getName() . ' Deleted'); |
|
| 19 | + $this->addFlashMessage(FlashMessageCategory::SUCCESS, 'Trick '.$trick->getName().' Deleted'); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | /** |
@@ -16,9 +16,9 @@ discard block |
||
| 16 | 16 | * Setting the first image as primary as specified in the wireframes |
| 17 | 17 | * @param AbstractTrickEvent $event |
| 18 | 18 | */ |
| 19 | - public function setFirstImageAsPrimary(AbstractTrickEvent $event){ |
|
| 19 | + public function setFirstImageAsPrimary(AbstractTrickEvent $event) { |
|
| 20 | 20 | $trick = $event->getEntity(); |
| 21 | - if($trick->getImages()->count() >0){ |
|
| 21 | + if ($trick->getImages()->count() > 0) { |
|
| 22 | 22 | /** @var Image $primImage */ |
| 23 | 23 | $primImage = $trick->getImages()->first(); |
| 24 | 24 | $primImage->setPrimaryImage(true); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | { |
| 36 | 36 | $trick = $event->getEntity(); |
| 37 | 37 | $this->sendToDatabase($event); |
| 38 | - $this->addFlashMessage(FlashMessageCategory::SUCCESS, 'Trick ' . $trick->getName() . ' saved'); |
|
| 38 | + $this->addFlashMessage(FlashMessageCategory::SUCCESS, 'Trick '.$trick->getName().' saved'); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | if ($event->getException() instanceof RedirectException) { |
| 31 | 31 | $redirectResponse = new RedirectResponse($event->getException()->getRedirectResponse()); |
| 32 | 32 | |
| 33 | - if($event->getException()->getMessage() !== ""){ |
|
| 33 | + if ($event->getException()->getMessage() !== "") { |
|
| 34 | 34 | $this->addFlashMessage(FlashMessageCategory::ERROR, $event->getException()->getMessage()); |
| 35 | 35 | } |
| 36 | 36 | |
@@ -26,12 +26,12 @@ discard block |
||
| 26 | 26 | public function buildForm(FormBuilderInterface $builder, array $options) |
| 27 | 27 | { |
| 28 | 28 | |
| 29 | - if($options['all_tags_json'] === '' || $options['trick_tags_json'] === ''){ |
|
| 29 | + if ($options['all_tags_json'] === '' || $options['trick_tags_json'] === '') { |
|
| 30 | 30 | throw new UnexpectedValueException("all_tags_json or trick_tags_json not defined in the form constructor"); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | $builder |
| 34 | - ->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { |
|
| 34 | + ->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) { |
|
| 35 | 35 | $trick = $event->getData(); |
| 36 | 36 | |
| 37 | 37 | $form = $event->getForm(); |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | 'class' => 'waves-effect waves-light btn red lighten-2 right mr-2', |
| 44 | 44 | 'onclick' => 'return confirm(\'are you sure?\')', |
| 45 | 45 | ] |
| 46 | - ]);; |
|
| 46 | + ]); ; |
|
| 47 | 47 | } |
| 48 | 48 | }) |
| 49 | 49 | ->add('name', TextType::class, [ |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | use Symfony\Component\OptionsResolver\OptionsResolver; |
| 10 | 10 | use Symfony\Component\PropertyAccess\PropertyAccess; |
| 11 | 11 | |
| 12 | -class ShowImageType extends AbstractType{ |
|
| 12 | +class ShowImageType extends AbstractType { |
|
| 13 | 13 | |
| 14 | 14 | public function configureOptions(OptionsResolver $resolver) |
| 15 | 15 | { |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | public function buildView(FormView $view, FormInterface $form, array $options) |
| 21 | 21 | { |
| 22 | 22 | |
| 23 | - if(isset($options['image_property'])){ |
|
| 23 | + if (isset($options['image_property'])) { |
|
| 24 | 24 | |
| 25 | 25 | // this will be whatever class/entity is bound to your form (e.g. Media) |
| 26 | 26 | $parentData = $form->getParent()->getData(); |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - public function getParent(){ |
|
| 42 | + public function getParent() { |
|
| 43 | 43 | return TextType::class; |
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | \ No newline at end of file |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | { |
| 47 | 47 | $this->retrieveUserFromToken($token); |
| 48 | 48 | |
| 49 | - if($this->isUserVerified()){ |
|
| 49 | + if ($this->isUserVerified()) { |
|
| 50 | 50 | $this->addFlashMessage(FlashMessageCategory::ERROR, 'Mail already verified'); |
| 51 | 51 | throw new RedirectException($this->urlGenerator->generate('app_login')); |
| 52 | 52 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | public function doesResetpasswordTokenValidateEmail(string $token):bool |
| 65 | 65 | { |
| 66 | 66 | $this->retrieveUserFromToken($token); |
| 67 | - if(!$this->isUserVerifiedDateTime()){ |
|
| 67 | + if (!$this->isUserVerifiedDateTime()) { |
|
| 68 | 68 | $this->addFlashMessage(FlashMessageCategory::ERROR, 'Token is too old, please use this form to resend a link'); |
| 69 | 69 | throw new RedirectException($this->urlGenerator->generate('app_forgotpassword')); |
| 70 | 70 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | */ |
| 98 | 98 | private function isUserVerifiedDateTime():bool |
| 99 | 99 | { |
| 100 | - if($this->user){ |
|
| 100 | + if ($this->user) { |
|
| 101 | 101 | return $this->user->isVerifiedDateTimeValid(); |
| 102 | 102 | } |
| 103 | 103 | return false; |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | private function isUserVerified():bool |
| 112 | 112 | { |
| 113 | - if($this->user){ |
|
| 113 | + if ($this->user) { |
|
| 114 | 114 | return $this->user->getVerified(); |
| 115 | 115 | } |
| 116 | 116 | return false; |
@@ -44,13 +44,13 @@ |
||
| 44 | 44 | public function revertHistory(Trick $trick, int $historyId, Request $request) |
| 45 | 45 | { |
| 46 | 46 | $submittedToken = $request->request->get('_token'); |
| 47 | - if (!$this->isCsrfTokenValid('revert-trick' . $historyId, $submittedToken)) { |
|
| 47 | + if (!$this->isCsrfTokenValid('revert-trick'.$historyId, $submittedToken)) { |
|
| 48 | 48 | throw new RedirectException($this->generateUrl('home'), 'Bad CSRF Token'); |
| 49 | 49 | } |
| 50 | 50 | $version = $request->request->get('_version'); |
| 51 | 51 | $this->trickHistory->revertToHistory($trick->getId(), $version); |
| 52 | 52 | |
| 53 | - $this->addFlashMessage(FlashMessageCategory::SUCCESS, 'Reverted ' . $trick->getName()); |
|
| 53 | + $this->addFlashMessage(FlashMessageCategory::SUCCESS, 'Reverted '.$trick->getName()); |
|
| 54 | 54 | return $this->redirectToRoute('trick.show', [ |
| 55 | 55 | 'id' => $trick->getId(), |
| 56 | 56 | 'slug' => $trick->getSlug(), |
@@ -90,7 +90,7 @@ |
||
| 90 | 90 | |
| 91 | 91 | public function getWebImage(): ?string |
| 92 | 92 | { |
| 93 | - return '/uploads/trick_images/' . $this->image; |
|
| 93 | + return '/uploads/trick_images/'.$this->image; |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | |