Passed
Branch feature/frontend (0b874a)
by Stone
04:52
created
src/Repository/CommentRepository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Repository/TrickRepository.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -31,20 +31,20 @@  discard block
 block discarded – undo
31 31
      */
32 32
     public function findLatestEdited(int $currentPage = 1, int $categoryId = 0)
33 33
     {
34
-        if($currentPage <1){
34
+        if ($currentPage < 1) {
35 35
             throw new \InvalidArgumentException("Current page can not be lower than one");
36 36
         }
37 37
 
38 38
         $query = $this->createQueryBuilder('t');
39 39
 
40
-        if($categoryId>0){
40
+        if ($categoryId > 0) {
41 41
             $query->where('t.category = :categoryId')
42 42
                 ->setParameter('categoryId', $categoryId);
43 43
         }
44 44
 
45 45
         $query->orderBy('t.editedAt', 'DESC')
46 46
             ->getQuery();
47
-        $paginator = $this->paginate($query,Trick::NUMBER_OF_DISPLAYED_TRICKS, $currentPage);
47
+        $paginator = $this->paginate($query, Trick::NUMBER_OF_DISPLAYED_TRICKS, $currentPage);
48 48
 
49 49
         return $paginator;
50 50
 
@@ -57,13 +57,13 @@  discard block
 block discarded – undo
57 57
      */
58 58
     public function findLatestEditedByTag(int $currentPage = 1, int $tagId = 0)
59 59
     {
60
-        if($currentPage <1){
60
+        if ($currentPage < 1) {
61 61
             throw new \InvalidArgumentException("Current page can not be lower than one");
62 62
         }
63 63
 
64 64
         $query = $this->createQueryBuilder('t');
65 65
 
66
-        if($tagId>0){
66
+        if ($tagId > 0) {
67 67
             $query->leftJoin('t.tags', 'tag')
68 68
                 ->where('tag = :tagId')
69 69
                 ->setParameter('tagId', $tagId);
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
         $query->orderBy('t.editedAt', 'DESC')
73 73
             ->getQuery();
74
-        $paginator = $this->paginate($query,Trick::NUMBER_OF_DISPLAYED_TRICKS, $currentPage);
74
+        $paginator = $this->paginate($query, Trick::NUMBER_OF_DISPLAYED_TRICKS, $currentPage);
75 75
 
76 76
         return $paginator;
77 77
 
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
 
85 85
         foreach ($searchTerms as $key => $term) {
86 86
             $queryBuilder
87
-                ->orWhere('p.name LIKE :term_' . $key)
88
-                ->setParameter('term_' . $key, '%' . $term . '%');
87
+                ->orWhere('p.name LIKE :term_'.$key)
88
+                ->setParameter('term_'.$key, '%'.$term.'%');
89 89
 
90 90
         }
91 91
 
Please login to merge, or discard this patch.
src/Pagination/PaginateRepositoryTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
src/Entity/AbstractAppEntity.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,6 +2,6 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Form/TrickFormType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
     public function buildForm(FormBuilderInterface $builder, array $options)
21 21
     {
22 22
 
23
-        if($options['all_tags_json'] === '' || $options['trick_tags_json'] === ''){
23
+        if ($options['all_tags_json'] === '' || $options['trick_tags_json'] === '') {
24 24
             throw new \UnexpectedValueException("all_tags_json or trick_tags_json not defined in the form constructor");
25 25
         }
26 26
 
Please login to merge, or discard this patch.
src/Form/ImageFormType.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,14 +27,14 @@
 block discarded – undo
27 27
                 'required' => true,
28 28
             ])
29 29
 
30
-            ->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event){
30
+            ->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) {
31 31
                 /** @var Trick $trick */
32 32
                 $image = $event->getData();
33 33
 
34 34
                 $form = $event->getForm();
35 35
 
36
-                if(!$image || $image->getId() === null){
37
-                    $form->add('imageFile', VichImageType::class,[
36
+                if (!$image || $image->getId() === null) {
37
+                    $form->add('imageFile', VichImageType::class, [
38 38
                         'required' => true,
39 39
                         'allow_delete' => false,
40 40
                         'download_uri' => false,
Please login to merge, or discard this patch.
src/Form/CommentFormType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
src/Form/VideoFormType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
                 'required' => true,
26 26
                 'help' => 'the video identifier, usually a unique code following "v="'
27 27
             ])
28
-            ->add( 'videoType', EntityType::class, [
28
+            ->add('videoType', EntityType::class, [
29 29
                 'class' => VideoType::class,
30 30
                 'choice_label' => 'site',
31 31
                 ])
Please login to merge, or discard this patch.