@@ -40,7 +40,7 @@ |
||
40 | 40 | { |
41 | 41 | |
42 | 42 | $submittedToken = $request->request->get('_token'); |
43 | - if (!$this->isCsrfTokenValid('delete-trick' . $trick->getId(), $submittedToken)) { |
|
43 | + if (!$this->isCsrfTokenValid('delete-trick'.$trick->getId(), $submittedToken)) { |
|
44 | 44 | throw new RedirectException($this->generateUrl('home'), 'Bad CSRF Token'); |
45 | 45 | } |
46 | 46 |
@@ -84,7 +84,7 @@ |
||
84 | 84 | |
85 | 85 | $history = array(); |
86 | 86 | //Only load the history if we are admin. Ease the load. |
87 | - if($this->isGranted('ROLE_ADMIN')){ |
|
87 | + if ($this->isGranted('ROLE_ADMIN')) { |
|
88 | 88 | $history = $this->trickHistory->getHistory($trick->getId()); |
89 | 89 | } |
90 | 90 |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public function getUsername(): string |
111 | 111 | { |
112 | - return (string)$this->userName; |
|
112 | + return (string) $this->userName; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | */ |
137 | 137 | public function getPassword(): string |
138 | 138 | { |
139 | - return (string)$this->password; |
|
139 | + return (string) $this->password; |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | public function setPassword(string $password): self |
@@ -328,6 +328,6 @@ discard block |
||
328 | 328 | $this->verified, |
329 | 329 | $this->verifiedDateTime, |
330 | 330 | $this->updatedAt, |
331 | - )=unserialize($serialized, ['allowed_classes' => false]); |
|
331 | + ) = unserialize($serialized, ['allowed_classes' => false]); |
|
332 | 332 | } |
333 | 333 | } |
@@ -81,7 +81,7 @@ |
||
81 | 81 | return $this; |
82 | 82 | } |
83 | 83 | |
84 | - public function __toString(){ |
|
84 | + public function __toString() { |
|
85 | 85 | return $this->Name; |
86 | 86 | } |
87 | 87 | } |
@@ -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); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function findBySearchQuery(string $query): array |
40 | 40 | { |
41 | - if($query === ""){ |
|
41 | + if ($query === "") { |
|
42 | 42 | return $this->findAll(); |
43 | 43 | } |
44 | 44 | $query = $this->sanitizeSearchQuery($query); |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | |
53 | 53 | foreach ($searchTerms as $key => $term) { |
54 | 54 | $queryBuilder |
55 | - ->orWhere('p.name LIKE :term_' . $key) |
|
56 | - ->setParameter('term_' . $key, '%' . $term . '%'); |
|
55 | + ->orWhere('p.name LIKE :term_'.$key) |
|
56 | + ->setParameter('term_'.$key, '%'.$term.'%'); |
|
57 | 57 | |
58 | 58 | } |
59 | 59 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | private function extractSearchTerms(string $searchQuery): array |
81 | 81 | { |
82 | 82 | $terms = array_unique(explode(' ', $searchQuery)); |
83 | - return array_filter($terms, function ($term) { |
|
83 | + return array_filter($terms, function($term) { |
|
84 | 84 | return 2 <= mb_strlen($term); |
85 | 85 | }); |
86 | 86 | } |