Passed
Push — master ( 89af9d...c2dbb1 )
by Francis
01:54
created
libraries/Blogger.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
    * Constructor
70 70
    * @param mixed $params associative array of parameters. See README.md
71 71
    */
72
-  function __construct($params=null) {
73
-    $this->ci =& /** @scrutinizer ignore-call */ get_instance();
72
+  function __construct($params = null) {
73
+    $this->ci = & /** @scrutinizer ignore-call */ get_instance();
74 74
     $this->ci->load->database();
75 75
     $this->table_name = self::TABLE_PREFIX . (isset($params["name"]) ? "_" . $params["name"] : "");
76 76
     $this->ci->load->database();
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
    *
95 95
    * @return bool                            True on Success, False if Not.
96 96
    */
97
-  public function install(string $blogName=null, string $adminTableName=null, string $adminIdColumnName=null, int $adminIdColumnConstraint=null): bool {
97
+  public function install(string $blogName = null, string $adminTableName = null, string $adminIdColumnName = null, int $adminIdColumnConstraint = null): bool {
98 98
     $blogName = $blogName === null ? $this->table_name : self::TABLE_PREFIX . "_" . $blogName;
99 99
     $this->ci->load->dbforge();
100 100
     $this->ci->dbforge->add_field("id");
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
    *
215 215
    * @return bool              True  if sucessfull without errors, false if not.
216 216
    */
217
-  public function loadEditor(string $callback, int $postId=null, bool $w3css=true): bool {
217
+  public function loadEditor(string $callback, int $postId = null, bool $w3css = true): bool {
218 218
     $this->loadScripts($w3css);
219 219
     $this->ci->load->helper("form");
220 220
     $data = array(
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
    *                       inputs. These are public string constants declared in
245 245
    *                       this file.
246 246
    */
247
-  public function savePost(int $posterId=null): string {
247
+  public function savePost(int $posterId = null): string {
248 248
     $action = $this->ci->security->xss_clean($this->ci->input->post("action"));
249 249
     if ($action == "save") {
250 250
       $id = $this->ci->security->xss_clean($this->ci->input->post("id"));
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
    *                         return all posts. false by default.
283 283
    * @return array Array of posts for a given page.
284 284
    */
285
-  public function getPosts($page, $limit, $filter=false, $hits=false) {
285
+  public function getPosts($page, $limit, $filter = false, $hits = false) {
286 286
     return $this->ci->bmanager->getPosts($page, $limit, $filter, $hits);
287 287
   }
288 288
   /**
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
    * @param  boolean $hits       [description]
296 296
    * @return [type]              [description]
297 297
    */
298
-  public function renderPostItems($view=null, $callback=null, $empty_view=null, $page=1, $limit=5, $filter=false, $hits=false, $slug=true) {
298
+  public function renderPostItems($view = null, $callback = null, $empty_view = null, $page = 1, $limit = 5, $filter = false, $hits = false, $slug = true) {
299 299
     if ($view == null || $empty_view == null) $this->ci->load->bind("francis94c/blog", $blogger);
300 300
     $posts = $this->getPosts($page, $limit, $filter, $hits);
301 301
     if (count($posts) == 0) {
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
    * @param  boolean $filter [description]
322 322
    * @return [type]          [description]
323 323
    */
324
-  public function getRecentPosts($limit=5, $filter=false) {
324
+  public function getRecentPosts($limit = 5, $filter = false) {
325 325
     return $this->ci->bmanager->getRecentPosts($limit, $filter);
326 326
   }
327 327
   /**
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
    * @param  [type] $view [description]
331 331
    * @return [type]       [description]
332 332
    */
333
-  public function renderPost($post, $view=null) {
333
+  public function renderPost($post, $view = null) {
334 334
     if (!is_array($post)) $post = $this->ci->bmanager->getPost($post);
335 335
     if (!$post) return false;
336 336
     $post["content"] = $this->ci->parsedown->text($post["content"]);
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
    * @param  [type] $postId [description]
367 367
    * @return [type]         [description]
368 368
    */
369
-  public function getPost($postId, $hit=true) {
369
+  public function getPost($postId, $hit = true) {
370 370
     return $this->ci->bmanager->getPost($postId, $hit);
371 371
   }
372 372
   /**
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
    * @param  boolean $filter [description]
403 403
    * @return [type]          [description]
404 404
    */
405
-  public function searchPosts($words, $page, $limit=0, $filter=false) {
405
+  public function searchPosts($words, $page, $limit = 0, $filter = false) {
406 406
     return $this->ci->bmanager->searchPosts($words, $page, $limit, $filter);
407 407
   }
408 408
 }
Please login to merge, or discard this patch.