@@ -90,11 +90,11 @@ |
||
90 | 90 | return $this; |
91 | 91 | } |
92 | 92 | |
93 | - public function getVideoIntegrationCode(){ |
|
93 | + public function getVideoIntegrationCode() { |
|
94 | 94 | return str_replace("{{code}}", $this->getCode(), $this->getVideoType()->getCode()); |
95 | 95 | } |
96 | 96 | |
97 | - public function getVideoIntegrationImage(){ |
|
97 | + public function getVideoIntegrationImage() { |
|
98 | 98 | return str_replace("{{code}}", $this->getCode(), $this->getVideoType()->getImageCode()); |
99 | 99 | } |
100 | 100 |
@@ -25,7 +25,7 @@ |
||
25 | 25 | $this->em->persist($trick); |
26 | 26 | $this->em->flush(); |
27 | 27 | |
28 | - $this->addFlash(FlashMessageCategory::SUCCESS, 'Video '. $video->getTitle() .' Added'); |
|
28 | + $this->addFlash(FlashMessageCategory::SUCCESS, 'Video '.$video->getTitle().' Added'); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
@@ -23,7 +23,7 @@ |
||
23 | 23 | $this->em->persist($trick); |
24 | 24 | $this->em->flush(); |
25 | 25 | |
26 | - $this->addFlash(FlashMessageCategory::SUCCESS, 'Video '. $video->getTitle() .' deleted'); |
|
26 | + $this->addFlash(FlashMessageCategory::SUCCESS, 'Video '.$video->getTitle().' deleted'); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
@@ -19,14 +19,14 @@ |
||
19 | 19 | parent::__construct($registry, Image::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.title LIKE :term_' . $key) |
|
29 | - ->setParameter('term_' . $key, '%' . $term . '%'); |
|
28 | + ->orWhere('p.title LIKE :term_'.$key) |
|
29 | + ->setParameter('term_'.$key, '%'.$term.'%'); |
|
30 | 30 | |
31 | 31 | } |
32 | 32 |
@@ -19,14 +19,14 @@ |
||
19 | 19 | parent::__construct($registry, Video::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.title LIKE :term_' . $key) |
|
29 | - ->setParameter('term_' . $key, '%' . $term . '%'); |
|
28 | + ->orWhere('p.title LIKE :term_'.$key) |
|
29 | + ->setParameter('term_'.$key, '%'.$term.'%'); |
|
30 | 30 | |
31 | 31 | } |
32 | 32 |
@@ -25,7 +25,7 @@ |
||
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 | ]) |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $imageSearch = $this->imageRepository->findBySearchQuery($searchTerms); |
80 | 80 | /** @var Image $image */ |
81 | 81 | foreach ($imageSearch as $image) { |
82 | - if($image->getTrick() !== null){ |
|
82 | + if ($image->getTrick() !== null) { |
|
83 | 83 | $trickList[] = $image->getTrick(); |
84 | 84 | } |
85 | 85 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $videoSearch = $this->videoRepository->findBySearchQuery($searchTerms); |
89 | 89 | /** @var Video $video */ |
90 | 90 | foreach ($videoSearch as $video) { |
91 | - if($video->getTrick() !== null){ |
|
91 | + if ($video->getTrick() !== null) { |
|
92 | 92 | $trickList[] = $video->getTrick(); |
93 | 93 | } |
94 | 94 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | private function extractSearchTerms(string $searchQuery): array |
115 | 115 | { |
116 | 116 | $terms = array_unique(explode(' ', $searchQuery)); |
117 | - return array_filter($terms, function ($term) { |
|
117 | + return array_filter($terms, function($term) { |
|
118 | 118 | return 2 <= mb_strlen($term); |
119 | 119 | }); |
120 | 120 | } |
@@ -38,12 +38,12 @@ |
||
38 | 38 | public function deleteTrickImage(video $video, Request $request) |
39 | 39 | { |
40 | 40 | $submittedToken = $request->request->get('_token'); |
41 | - if (!$this->isCsrfTokenValid('delete-video' . $video->getId(), $submittedToken)) { |
|
41 | + if (!$this->isCsrfTokenValid('delete-video'.$video->getId(), $submittedToken)) { |
|
42 | 42 | throw new RedirectException($this->generateUrl('home'), 'Bad CSRF Token'); |
43 | 43 | } |
44 | 44 | |
45 | 45 | $trick = $video->getTrick(); |
46 | - if($trick !== null){ |
|
46 | + if ($trick !== null) { |
|
47 | 47 | $event = new VideoDeleteEvent($video, $video->getTrick()); |
48 | 48 | $this->dispatcher->dispatch(VideoDeleteEvent::NAME, $event); |
49 | 49 | } |