Passed
Push — Comments ( 58658e...bac4c7 )
by Stone
02:28
created
App/Models/CommentModel.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 use Core\Container;
7 7
 use Core\Constant;
8 8
 
9
-class CommentModel extends Model{
9
+class CommentModel extends Model {
10 10
 
11 11
     private $commentTbl;
12 12
     private $userTbl;
@@ -136,9 +136,9 @@  discard block
 block discarded – undo
136 136
      * @return int
137 137
      * @throws \Exception
138 138
      */
139
-    public function addComment(int $postId, int $userId, string $message, bool $admin=false):int
139
+    public function addComment(int $postId, int $userId, string $message, bool $admin = false):int
140 140
     {
141
-        $sql="
141
+        $sql = "
142 142
             INSERT INTO $this->commentTbl (users_idusers, posts_idposts, comment, approved)
143 143
             VALUES (:userId, :postId, :comment, :approved)
144 144
         ";
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         $this->bind(':approved', $admin);
150 150
 
151 151
         $this->execute();
152
-        return (int)$this->dbh->lastInsertId();
152
+        return (int) $this->dbh->lastInsertId();
153 153
     }
154 154
 
155 155
     /**
Please login to merge, or discard this patch.
App/Controllers/Post.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@
 block discarded – undo
88 88
         $postId = $this->request->getData("postId");
89 89
 
90 90
         //check if we are admin, Admins do not need moderation
91
-        $admin = $this->session->get('user_role_level')>= Constant::ADMIN_LEVEL;
91
+        $admin = $this->session->get('user_role_level') >= Constant::ADMIN_LEVEL;
92 92
 
93 93
         $this->commentModel->addComment($postId, $userId, $comment, $admin);
94 94
 
Please login to merge, or discard this patch.