@@ -9,13 +9,13 @@ |
||
| 9 | 9 | use Symfony\Component\OptionsResolver\OptionsResolver; |
| 10 | 10 | use Vich\UploaderBundle\Form\Type\VichImageType; |
| 11 | 11 | |
| 12 | -class UserProfileFormType extends AbstractType{ |
|
| 12 | +class UserProfileFormType extends AbstractType { |
|
| 13 | 13 | |
| 14 | 14 | public function buildForm(FormBuilderInterface $builder, array $options) |
| 15 | 15 | { |
| 16 | 16 | $builder |
| 17 | 17 | ->add('UserName', TextType::class) |
| 18 | - ->add('imageFile', VichImageType::class,[ |
|
| 18 | + ->add('imageFile', VichImageType::class, [ |
|
| 19 | 19 | 'required' => false, |
| 20 | 20 | 'allow_delete' => false, |
| 21 | 21 | 'download_uri' => false, |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | use Symfony\Component\Validator\Constraints\Length; |
| 12 | 12 | use Symfony\Component\Validator\Constraints\NotBlank; |
| 13 | 13 | |
| 14 | -class UserChangePasswordFormType extends AbstractType{ |
|
| 14 | +class UserChangePasswordFormType extends AbstractType { |
|
| 15 | 15 | |
| 16 | 16 | public function buildForm(FormBuilderInterface $builder, array $options) |
| 17 | 17 | { |
@@ -43,13 +43,13 @@ |
||
| 43 | 43 | public function revertHistory(Trick $trick, int $historyId, Request $request) |
| 44 | 44 | { |
| 45 | 45 | $submittedToken = $request->request->get('_token'); |
| 46 | - if (!$this->isCsrfTokenValid('revert-trick' . $historyId, $submittedToken)) { |
|
| 46 | + if (!$this->isCsrfTokenValid('revert-trick'.$historyId, $submittedToken)) { |
|
| 47 | 47 | throw new RedirectException($this->generateUrl('home'), 'Bad CSRF Token'); |
| 48 | 48 | } |
| 49 | 49 | $version = $request->request->get('_version'); |
| 50 | 50 | $this->trickHistory->revertToHistory($trick->getId(), $version); |
| 51 | 51 | |
| 52 | - $this->addFlash(FlashMessageCategory::SUCCESS, 'Reverted ' . $trick->getName()); |
|
| 52 | + $this->addFlash(FlashMessageCategory::SUCCESS, 'Reverted '.$trick->getName()); |
|
| 53 | 53 | return $this->redirectToRoute('trick.show', [ |
| 54 | 54 | 'id' => $trick->getId(), |
| 55 | 55 | 'slug' => $trick->getSlug(), |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | * @param $version |
| 39 | 39 | * Revert a trick to a history checkpoint. |
| 40 | 40 | */ |
| 41 | - public function revertToHistory($id, $version){ |
|
| 41 | + public function revertToHistory($id, $version) { |
|
| 42 | 42 | $trick = $this->em->find('App\Entity\Trick', $id); |
| 43 | 43 | $this->repo->revert($trick, $version); |
| 44 | 44 | $this->em->persist($trick); |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | public function autoLogon(User $user): Event |
| 51 | 51 | { |
| 52 | 52 | $request = $this->requestStack->getCurrentRequest(); |
| 53 | - if($request === null){ |
|
| 53 | + if ($request === null) { |
|
| 54 | 54 | throw new Exception('request is null'); |
| 55 | 55 | } |
| 56 | 56 | //Login user |
@@ -88,7 +88,7 @@ |
||
| 88 | 88 | return $this; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - public function __toString(){ |
|
| 91 | + public function __toString() { |
|
| 92 | 92 | return $this->Name; |
| 93 | 93 | } |
| 94 | 94 | |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; |
| 7 | 7 | use Symfony\Component\Routing\Annotation\Route; |
| 8 | 8 | |
| 9 | -class TricksByTagController extends AbstractController{ |
|
| 9 | +class TricksByTagController extends AbstractController { |
|
| 10 | 10 | |
| 11 | 11 | /** |
| 12 | 12 | * @Route("/trick/tag/{id}-{slug}", name="trick.tag", methods={"GET"}) |
@@ -14,9 +14,9 @@ discard block |
||
| 14 | 14 | * @param string $slug |
| 15 | 15 | * @return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response |
| 16 | 16 | */ |
| 17 | - public function showTricksByTag(Tag $tag, string $slug){ |
|
| 17 | + public function showTricksByTag(Tag $tag, string $slug) { |
|
| 18 | 18 | |
| 19 | - if($tag->getSlug() !== $slug){ |
|
| 19 | + if ($tag->getSlug() !== $slug) { |
|
| 20 | 20 | return $this->redirectToRoute('trick.tag', [ |
| 21 | 21 | 'id' => $tag->getId(), |
| 22 | 22 | 'slug' => $tag->getSlug() |
@@ -19,14 +19,14 @@ |
||
| 19 | 19 | parent::__construct($registry, Category::class); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | - public function findBySearchQuery(array $searchTerms){ |
|
| 22 | + public function findBySearchQuery(array $searchTerms) { |
|
| 23 | 23 | |
| 24 | 24 | $queryBuilder = $this->createQueryBuilder('p'); |
| 25 | 25 | |
| 26 | 26 | foreach ($searchTerms as $key => $term) { |
| 27 | 27 | $queryBuilder |
| 28 | - ->orWhere('p.Name LIKE :term_' . $key) |
|
| 29 | - ->setParameter('term_' . $key, '%' . $term . '%'); |
|
| 28 | + ->orWhere('p.Name LIKE :term_'.$key) |
|
| 29 | + ->setParameter('term_'.$key, '%'.$term.'%'); |
|
| 30 | 30 | |
| 31 | 31 | } |
| 32 | 32 | |
@@ -32,14 +32,14 @@ |
||
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | |
| 35 | - public function findBySearchQuery(array $searchTerms){ |
|
| 35 | + public function findBySearchQuery(array $searchTerms) { |
|
| 36 | 36 | |
| 37 | 37 | $queryBuilder = $this->createQueryBuilder('p'); |
| 38 | 38 | |
| 39 | 39 | foreach ($searchTerms as $key => $term) { |
| 40 | 40 | $queryBuilder |
| 41 | - ->orWhere('p.name LIKE :term_' . $key) |
|
| 42 | - ->setParameter('term_' . $key, '%' . $term . '%'); |
|
| 41 | + ->orWhere('p.name LIKE :term_'.$key) |
|
| 42 | + ->setParameter('term_'.$key, '%'.$term.'%'); |
|
| 43 | 43 | |
| 44 | 44 | } |
| 45 | 45 | |