Passed
Push — master ( 488f68...c32df4 )
by Francis
01:18
created
libraries/Blogger.php 1 patch
Braces   +21 added lines, -7 removed lines patch added patch discarded remove patch
@@ -89,7 +89,9 @@  discard block
 block discarded – undo
89 89
     $this->ci->dbforge->add_field($fields);
90 90
     $this->ci->dbforge->add_field("date_created TIMESTAMP DEFAULT CURRENT_TIMESTAMP");
91 91
     $attributes = array('ENGINE' => 'InnoDB');
92
-    if (!$this->ci->dbforge->create_table($blogName, true, $attributes)) return false;
92
+    if (!$this->ci->dbforge->create_table($blogName, true, $attributes)) {
93
+      return false;
94
+    }
93 95
     return true;
94 96
   }
95 97
   /**
@@ -183,7 +185,9 @@  discard block
 block discarded – undo
183 185
     } elseif ($action == "publish" || $action == "createAndPublish") {
184 186
       if ($action == "publish") {
185 187
         $id = $this->ci->security->xss_clean($this->ci->input->post("id"));
186
-        if ($id == "") return self::ABORT;
188
+        if ($id == "") {
189
+          return self::ABORT;
190
+        }
187 191
         $this->ci->bmanager->savePost($id, $this->ci->security->xss_clean($this->ci->input->post("title")), $this->ci->security->xss_clean($this->ci->input->post("editor")), $posterId);
188 192
         $this->ci->bmanager->publishPost($id, true);
189 193
         return self::PUBLISH;
@@ -194,7 +198,9 @@  discard block
 block discarded – undo
194 198
         return self::ABORT;
195 199
       }
196 200
     } elseif ($action == "delete") {
197
-      if ($this->ci->bmanager->deletePost($this->ci->security->xss_clean($this->ci->input->post("id")))) return self::DELETE;
201
+      if ($this->ci->bmanager->deletePost($this->ci->security->xss_clean($this->ci->input->post("id")))) {
202
+        return self::DELETE;
203
+      }
198 204
     }
199 205
     return false;
200 206
   }
@@ -221,7 +227,9 @@  discard block
 block discarded – undo
221 227
    * @return [type]              [description]
222 228
    */
223 229
   public function renderPostItems($view=null, $callback=null, $empty_view=null, $page=1, $limit=5, $filter=false, $hits=false, $slug=true) {
224
-    if ($view == null || $empty_view == null) $this->ci->load->bind("francis94c/blog", $blogger);
230
+    if ($view == null || $empty_view == null) {
231
+      $this->ci->load->bind("francis94c/blog", $blogger);
232
+    }
225 233
     $posts = $this->getPosts($page, $limit, $filter, $hits);
226 234
     if (count($posts) == 0) {
227 235
       if ($empty_view == null) { $blogger->load->view("empty"); } else {
@@ -256,8 +264,12 @@  discard block
 block discarded – undo
256 264
    * @return [type]       [description]
257 265
    */
258 266
   public function renderPost($post, $view=null) {
259
-    if (!is_array($post)) $post = $this->ci->bmanager->getPost($post);
260
-    if (!$post) return false;
267
+    if (!is_array($post)) {
268
+      $post = $this->ci->bmanager->getPost($post);
269
+    }
270
+    if (!$post) {
271
+      return false;
272
+    }
261 273
     $post["content"] = $this->ci->parsedown->text($post["content"]);
262 274
     if ($view == null) {
263 275
       $this->ci->load->splint("francis94c/blog", "-post_item", $post);
@@ -275,7 +287,9 @@  discard block
 block discarded – undo
275 287
     $data = array();
276 288
     $data["title"] = $post["title"];
277 289
     $data["description"] = substr($post["content"], 0, 154);
278
-    if (isset($post["share_image"])) $data["image_link"] = $post["share_image"];
290
+    if (isset($post["share_image"])) {
291
+      $data["image_link"] = $post["share_image"];
292
+    }
279 293
     $data["url"] = current_url();
280 294
     return $this->ci->load->splint(self::PACKAGE, "-meta_og", $data, true);
281 295
   }
Please login to merge, or discard this patch.