Passed
Push — Showing-Posts ( 0498b6...15c50f )
by Stone
01:42
created
App/Models/PostModel.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -225,13 +225,13 @@
 block discarded – undo
225 225
     }
226 226
 
227 227
     /**
228
- * get the list of all the posts.
229
- * @param int $offset
230
- * @param array $select array of limiters [$key => $val] will convert to "where $key = $val"
231
- * @param int $limit
232
- * @return array
233
- * @throws \ErrorException
234
- */
228
+     * get the list of all the posts.
229
+     * @param int $offset
230
+     * @param array $select array of limiters [$key => $val] will convert to "where $key = $val"
231
+     * @param int $limit
232
+     * @return array
233
+     * @throws \ErrorException
234
+     */
235 235
     public function getPosts(int $offset = 0, array $select = [], int $limit = Constant::POSTS_PER_PAGE): array
236 236
     {
237 237
         return $this->getAllPublishedPosts($offset, $limit, false, $select);
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         $this->query($sql);
114 114
         if ($select != null) {
115 115
             foreach ($select as $col => $val) {
116
-                $this->bind(":" . $col, $val);
116
+                $this->bind(":".$col, $val);
117 117
             }
118 118
         }
119 119
         $this->bind(":limit", $limit);
@@ -130,13 +130,13 @@  discard block
 block discarded – undo
130 130
      * @return int number of posts
131 131
      * @throws Exception
132 132
      */
133
-    private function countNumberPosts(array $select = [], $published=true): int
133
+    private function countNumberPosts(array $select = [], $published = true): int
134 134
     {
135 135
         $sql = "SELECT COUNT(*) FROM $this->postsTbl";
136 136
         if ($this->queryWithTags) {
137 137
             $sql .= " LEFT JOIN $this->postTagTbl ON $this->postsTbl.idposts = $this->postTagTbl.post_idposts";
138 138
         }
139
-        if($published)
139
+        if ($published)
140 140
         {
141 141
             $sql .= " WHERE published = 1";
142 142
         }
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
         $this->query($sql);
152 152
         if ($select != null) {
153 153
             foreach ($select as $col => $val) {
154
-                $this->bind(":" . $col, $val);
154
+                $this->bind(":".$col, $val);
155 155
             }
156 156
         }
157 157
         $this->execute();
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 
335 335
         $this->execute();
336 336
 
337
-        return (int)$this->dbh->lastInsertId();
337
+        return (int) $this->dbh->lastInsertId();
338 338
     }
339 339
 
340 340
     /**
Please login to merge, or discard this patch.