Passed
Push — Comments ( f56c48...58658e )
by Stone
02:01
created
App/Controllers/Ajax/Comment.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@
 block discarded – undo
24 24
     {
25 25
         $this->onlyAdmin();
26 26
         $this->onlyPost();
27
-        $state = (bool)($this->request->getData("state") === 'true');
28
-        $commentId = (int)$this->request->getData("commentId");
27
+        $state = (bool) ($this->request->getData("state") === 'true');
28
+        $commentId = (int) $this->request->getData("commentId");
29 29
 
30 30
         $result = array();
31 31
         $result["success"] = $this->commentModel->setApproved(!$state, $commentId);
Please login to merge, or discard this patch.
App/Models/CommentModel.php 1 patch
Spacing   +3 added lines, -3 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;
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
      */
138 138
     public function addComment(int $postId, int $userId, string $message):int
139 139
     {
140
-        $sql="
140
+        $sql = "
141 141
             INSERT INTO $this->commentTbl (users_idusers, posts_idposts, comment, approved)
142 142
             VALUES (:userId, :postId, :comment, 0)
143 143
         ";
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         $this->bind(':comment', $message);
148 148
 
149 149
         $this->execute();
150
-        return (int)$this->dbh->lastInsertId();
150
+        return (int) $this->dbh->lastInsertId();
151 151
     }
152 152
 
153 153
     /**
Please login to merge, or discard this patch.