Passed
Branch feature/comments (12b220)
by Stone
04:53
created
src/Controller/Trick/Admin/EditTrickController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
      */
42 42
     private $tagRepository;
43 43
 
44
-    public function __construct(EventDispatcherInterface $dispatcher, TrickHistory $trickHistory, TagRepository $tagRepository )
44
+    public function __construct(EventDispatcherInterface $dispatcher, TrickHistory $trickHistory, TagRepository $tagRepository)
45 45
     {
46 46
         $this->dispatcher = $dispatcher;
47 47
         $this->trickHistory = $trickHistory;
Please login to merge, or discard this patch.
src/Controller/Comment/EditCommentController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -85,10 +85,10 @@
 block discarded – undo
85 85
      * Checks if the user is admin or author of the comment.
86 86
      * Thows a redirect to the trick show page
87 87
      */
88
-    private function checkSecurity(Comment $comment){
89
-        if(!($this->isGranted('ROLE_ADMIN') || $this->getUser()->getId() === $comment->getUser()->getId()))
88
+    private function checkSecurity(Comment $comment) {
89
+        if (!($this->isGranted('ROLE_ADMIN') || $this->getUser()->getId() === $comment->getUser()->getId()))
90 90
         {
91
-            Throw new RedirectException($this->generateUrl('trick.show', ['id'=> $comment->getTrick()->getId(), 'slug'=> $comment->getTrick()->getSlug()]),"You are not allowed to edit this comment");
91
+            Throw new RedirectException($this->generateUrl('trick.show', ['id'=> $comment->getTrick()->getId(), 'slug'=> $comment->getTrick()->getSlug()]), "You are not allowed to edit this comment");
92 92
         }
93 93
     }
94 94
 
Please login to merge, or discard this patch.
src/Controller/Comment/DeleteCommentController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function deleteTrick(Comment $comment, Request $request)
36 36
     {
37
-        if(!($this->isGranted('ROLE_ADMIN') || $this->getUser()->getId() === $comment->getUser()->getId()))
37
+        if (!($this->isGranted('ROLE_ADMIN') || $this->getUser()->getId() === $comment->getUser()->getId()))
38 38
         {
39
-            Throw new RedirectException($this->generateUrl('trick.show', ['id'=> $comment->getTrick()->getId(), 'slug'=> $comment->getTrick()->getSlug()]),"You are not allowed to edit this comment");
39
+            Throw new RedirectException($this->generateUrl('trick.show', ['id'=> $comment->getTrick()->getId(), 'slug'=> $comment->getTrick()->getSlug()]), "You are not allowed to edit this comment");
40 40
         }
41 41
 
42 42
         $submittedToken = $request->request->get('_token');
43
-        if (!$this->isCsrfTokenValid('delete-comment' . $comment->getId(), $submittedToken)) {
43
+        if (!$this->isCsrfTokenValid('delete-comment'.$comment->getId(), $submittedToken)) {
44 44
             throw new RedirectException($this->generateUrl('home'), 'Bad CSRF Token');
45 45
         }
46 46
 
@@ -49,6 +49,6 @@  discard block
 block discarded – undo
49 49
         $event = new CommentDeletedEvent($comment);
50 50
         $this->dispatcher->dispatch(CommentDeletedEvent::NAME, $event);
51 51
 
52
-        return $this->redirectToRoute('trick.show',['id'=> $trick->getId(), 'slug' => $trick->getSlug()]);
52
+        return $this->redirectToRoute('trick.show', ['id'=> $trick->getId(), 'slug' => $trick->getSlug()]);
53 53
     }
54 54
 }
55 55
\ No newline at end of file
Please login to merge, or discard this patch.