| @@ -61,7 +61,7 @@ | ||
| 61 | 61 |          $page = $request->get('page') ?? 1; | 
| 62 | 62 | |
| 63 | 63 | /** @var Paginator $tricks */ | 
| 64 | - $tricks = $this->trickRepository->findLatestEdited($page, (int)$categoryId); | |
| 64 | + $tricks = $this->trickRepository->findLatestEdited($page, (int) $categoryId); | |
| 65 | 65 | |
| 66 | 66 | $nextPage = $this->pagePagination->nextPage($tricks, $page, Trick::NUMBER_OF_DISPLAYED_TRICKS); | 
| 67 | 67 | |
| @@ -40,7 +40,7 @@ discard block | ||
| 40 | 40 | 'save_button_label' => 'Update', | 
| 41 | 41 | ]); | 
| 42 | 42 | |
| 43 | -        if($request->isXmlHttpRequest()){ | |
| 43 | +        if ($request->isXmlHttpRequest()) { | |
| 44 | 44 |              $render = $this->renderView('comment/_comment-form.html.twig', [ | 
| 45 | 45 | 'comment' => $comment, | 
| 46 | 46 | 'commentForm' => $commentForm->createView(), | 
| @@ -97,10 +97,10 @@ discard block | ||
| 97 | 97 | * Checks if the user is admin or author of the comment. | 
| 98 | 98 | * Thows a redirect to the trick show page | 
| 99 | 99 | */ | 
| 100 | -    private function checkSecurity(Comment $comment){ | |
| 101 | -        if(!($this->isGranted('ROLE_ADMIN') || $this->getUser()->getId() === $comment->getUser()->getId())) | |
| 100 | +    private function checkSecurity(Comment $comment) { | |
| 101 | +        if (!($this->isGranted('ROLE_ADMIN') || $this->getUser()->getId() === $comment->getUser()->getId())) | |
| 102 | 102 |          { | 
| 103 | -            Throw new RedirectException($this->generateUrl('trick.show', ['id'=> $comment->getTrick()->getId(), 'slug'=> $comment->getTrick()->getSlug()]),"You are not allowed to edit this comment"); | |
| 103 | +            Throw new RedirectException($this->generateUrl('trick.show', ['id'=> $comment->getTrick()->getId(), 'slug'=> $comment->getTrick()->getSlug()]), "You are not allowed to edit this comment"); | |
| 104 | 104 | } | 
| 105 | 105 | } | 
| 106 | 106 | |
| @@ -21,7 +21,7 @@ discard block | ||
| 21 | 21 | |
| 22 | 22 | /** @var Image $trickImage */ | 
| 23 | 23 |              foreach ($trickImages as $trickImage) { | 
| 24 | -                if ($trickImage->getPrimaryImage() && $trickImage !== $image ) { | |
| 24 | +                if ($trickImage->getPrimaryImage() && $trickImage !== $image) { | |
| 25 | 25 | $trickImage->setPrimaryImage(false); | 
| 26 | 26 | } | 
| 27 | 27 | |
| @@ -41,9 +41,9 @@ discard block | ||
| 41 | 41 | /** @var Image $trickImage */ | 
| 42 | 42 |          foreach ($trickImages as $trickImage) { | 
| 43 | 43 |              if ($trickImage === $image) { | 
| 44 | -                if($trickImage->getPrimaryImage()){ | |
| 44 | +                if ($trickImage->getPrimaryImage()) { | |
| 45 | 45 | $trickImage->setPrimaryImage(false); | 
| 46 | -                }else{ | |
| 46 | +                } else { | |
| 47 | 47 | $trickImage->setPrimaryImage(true); | 
| 48 | 48 | } | 
| 49 | 49 | |
| @@ -35,7 +35,7 @@ | ||
| 35 | 35 |              ->orderBy('c.createdAt', 'DESC') | 
| 36 | 36 | ->getQuery(); | 
| 37 | 37 | |
| 38 | - $paginator = $this->paginate($query,Comment::NUMBER_OF_DISPLAYED_COMMENTS, $currentPage); | |
| 38 | + $paginator = $this->paginate($query, Comment::NUMBER_OF_DISPLAYED_COMMENTS, $currentPage); | |
| 39 | 39 | |
| 40 | 40 | return $paginator; | 
| 41 | 41 | } | 
| @@ -5,7 +5,7 @@ | ||
| 5 | 5 | |
| 6 | 6 | use Doctrine\ORM\Tools\Pagination\Paginator; | 
| 7 | 7 | |
| 8 | -trait PaginateRepositoryTrait{ | |
| 8 | +trait PaginateRepositoryTrait { | |
| 9 | 9 | |
| 10 | 10 | public function paginate($dql, int $limit, int $page = 1) | 
| 11 | 11 |      { | 
| @@ -2,6 +2,6 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace App\Entity; | 
| 4 | 4 | |
| 5 | -abstract class AbstractAppEntity{ | |
| 5 | +abstract class AbstractAppEntity { | |
| 6 | 6 | |
| 7 | 7 | } | 
| 8 | 8 | \ No newline at end of file | 
| @@ -9,7 +9,7 @@ | ||
| 9 | 9 | use Symfony\Component\Form\FormBuilderInterface; | 
| 10 | 10 | use Symfony\Component\OptionsResolver\OptionsResolver; | 
| 11 | 11 | |
| 12 | -class CommentFormType extends AbstractType{ | |
| 12 | +class CommentFormType extends AbstractType { | |
| 13 | 13 | |
| 14 | 14 | public function buildForm(FormBuilderInterface $builder, array $options) | 
| 15 | 15 |      { | 
| @@ -19,7 +19,7 @@ | ||
| 19 | 19 | public function buildForm(FormBuilderInterface $builder, array $options) | 
| 20 | 20 |      { | 
| 21 | 21 | $builder | 
| 22 | -            ->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { | |
| 22 | +            ->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) { | |
| 23 | 23 | $image = $event->getData(); | 
| 24 | 24 | |
| 25 | 25 | $form = $event->getForm(); | 
| @@ -31,8 +31,7 @@ | ||
| 31 | 31 | 'download_uri' => false, | 
| 32 | 32 | 'image_uri' => false, | 
| 33 | 33 | ]); | 
| 34 | - } | |
| 35 | -                else { | |
| 34 | +                } else { | |
| 36 | 35 |                      $form->add('image', ShowImageType::class, [ | 
| 37 | 36 | 'image_property' => 'webImage', | 
| 38 | 37 | 'mapped' => false, | 
| @@ -18,11 +18,11 @@ discard block | ||
| 18 | 18 | public function buildForm(FormBuilderInterface $builder, array $options) | 
| 19 | 19 |      { | 
| 20 | 20 | $builder | 
| 21 | -            ->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event){ | |
| 21 | +            ->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) { | |
| 22 | 22 | $video = $event->getData(); | 
| 23 | 23 | |
| 24 | 24 | $form = $event->getForm(); | 
| 25 | -                if ($video && $video->getId() !== null){ | |
| 25 | +                if ($video && $video->getId() !== null) { | |
| 26 | 26 |                      $form->add('vidImage', ShowImageType::class, [ | 
| 27 | 27 | 'image_property' => 'videoIntegrationImage', | 
| 28 | 28 | 'mapped' => false, | 
| @@ -40,7 +40,7 @@ discard block | ||
| 40 | 40 | 'required' => true, | 
| 41 | 41 | 'help' => 'the video identifier, usually a unique code following "v="' | 
| 42 | 42 | ]) | 
| 43 | - ->add( 'videoType', EntityType::class, [ | |
| 43 | +            ->add('videoType', EntityType::class, [ | |
| 44 | 44 | 'class' => VideoType::class, | 
| 45 | 45 | 'choice_label' => 'site', | 
| 46 | 46 | ]) |