@@ -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 | ]) |
@@ -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 |
@@ -22,7 +22,7 @@ |
||
22 | 22 | public function buildForm(FormBuilderInterface $builder, array $options) |
23 | 23 | { |
24 | 24 | |
25 | - if($options['all_tags_json'] === '' || $options['trick_tags_json'] === ''){ |
|
25 | + if ($options['all_tags_json'] === '' || $options['trick_tags_json'] === '') { |
|
26 | 26 | throw new UnexpectedValueException("all_tags_json or trick_tags_json not defined in the form constructor"); |
27 | 27 | } |
28 | 28 |
@@ -32,20 +32,20 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public function findLatestEdited(int $currentPage = 1, int $categoryId = 0) |
34 | 34 | { |
35 | - if($currentPage <1){ |
|
35 | + if ($currentPage < 1) { |
|
36 | 36 | throw new InvalidArgumentException("Current page can not be lower than one"); |
37 | 37 | } |
38 | 38 | |
39 | 39 | $query = $this->createQueryBuilder('t'); |
40 | 40 | |
41 | - if($categoryId>0){ |
|
41 | + if ($categoryId > 0) { |
|
42 | 42 | $query->where('t.category = :categoryId') |
43 | 43 | ->setParameter('categoryId', $categoryId); |
44 | 44 | } |
45 | 45 | |
46 | 46 | $query->orderBy('t.editedAt', 'DESC') |
47 | 47 | ->getQuery(); |
48 | - $paginator = $this->paginate($query,Trick::NUMBER_OF_DISPLAYED_TRICKS, $currentPage); |
|
48 | + $paginator = $this->paginate($query, Trick::NUMBER_OF_DISPLAYED_TRICKS, $currentPage); |
|
49 | 49 | |
50 | 50 | return $paginator; |
51 | 51 | |
@@ -58,13 +58,13 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function findLatestEditedByTag(int $currentPage = 1, int $tagId = 0) |
60 | 60 | { |
61 | - if($currentPage <1){ |
|
61 | + if ($currentPage < 1) { |
|
62 | 62 | throw new InvalidArgumentException("Current page can not be lower than one"); |
63 | 63 | } |
64 | 64 | |
65 | 65 | $query = $this->createQueryBuilder('t'); |
66 | 66 | |
67 | - if($tagId>0){ |
|
67 | + if ($tagId > 0) { |
|
68 | 68 | $query->leftJoin('t.tags', 'tag') |
69 | 69 | ->where('tag = :tagId') |
70 | 70 | ->setParameter('tagId', $tagId); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | $query->orderBy('t.editedAt', 'DESC') |
74 | 74 | ->getQuery(); |
75 | - $paginator = $this->paginate($query,Trick::NUMBER_OF_DISPLAYED_TRICKS, $currentPage); |
|
75 | + $paginator = $this->paginate($query, Trick::NUMBER_OF_DISPLAYED_TRICKS, $currentPage); |
|
76 | 76 | |
77 | 77 | return $paginator; |
78 | 78 | |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | |
86 | 86 | foreach ($searchTerms as $key => $term) { |
87 | 87 | $queryBuilder |
88 | - ->orWhere('p.name LIKE :term_' . $key) |
|
89 | - ->setParameter('term_' . $key, '%' . $term . '%'); |
|
88 | + ->orWhere('p.name LIKE :term_'.$key) |
|
89 | + ->setParameter('term_'.$key, '%'.$term.'%'); |
|
90 | 90 | |
91 | 91 | } |
92 | 92 |