Completed
Push — master ( c2dbb1...acd3fe )
by Francis
01:21
created
libraries/Blogger.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
    * Constructor
75 75
    * @param mixed $params associative array of parameters. See README.md
76 76
    */
77
-  function __construct($params=null) {
78
-    $this->ci =& /** @scrutinizer ignore-call */ get_instance();
77
+  function __construct($params = null) {
78
+    $this->ci = & /** @scrutinizer ignore-call */ get_instance();
79 79
     $this->ci->load->database();
80 80
     $this->table_name = self::TABLE_PREFIX . (isset($params["name"]) ? "_" . $params["name"] : "");
81 81
     $this->ci->load->database();
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
    *
100 100
    * @return bool                            True on Success, False if Not.
101 101
    */
102
-  public function install(string $blogName=null, string $adminTableName=null, string $adminIdColumnName=null, int $adminIdColumnConstraint=null): bool {
102
+  public function install(string $blogName = null, string $adminTableName = null, string $adminIdColumnName = null, int $adminIdColumnConstraint = null): bool {
103 103
     $blogName = $blogName === null ? $this->table_name : self::TABLE_PREFIX . "_" . $blogName;
104 104
     $this->ci->load->dbforge();
105 105
     $this->ci->dbforge->add_field("id");
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
    *
220 220
    * @return bool              True  if sucessfull without errors, false if not.
221 221
    */
222
-  public function loadEditor(string $callback, int $postId=null, bool $w3css=true): bool {
222
+  public function loadEditor(string $callback, int $postId = null, bool $w3css = true): bool {
223 223
     $this->loadScripts($w3css);
224 224
     $this->ci->load->helper("form");
225 225
     $data = array(
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
    *                       inputs. These are public string constants declared in
250 250
    *                       this file.
251 251
    */
252
-  public function savePost(int $posterId=null): string {
252
+  public function savePost(int $posterId = null): string {
253 253
     $action = $this->ci->security->xss_clean($this->ci->input->post("action"));
254 254
     if ($action == "save") {
255 255
       $id = $this->ci->security->xss_clean($this->ci->input->post("id"));
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
    *
294 294
    * @return array           Array of posts for a given page.
295 295
    */
296
-  public function getPosts(int $page, int $limit, bool $filter=false, bool $hits=false): array {
296
+  public function getPosts(int $page, int $limit, bool $filter = false, bool $hits = false): array {
297 297
     return $this->ci->bmanager->getPosts($page, $limit, $filter, $hits);
298 298
   }
299 299
   /**
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
    * @param  boolean $hits       [description]
307 307
    * @return [type]              [description]
308 308
    */
309
-  public function renderPostItems($view=null, $callback=null, $empty_view=null, $page=1, $limit=5, $filter=false, $hits=false, $slug=true) {
309
+  public function renderPostItems($view = null, $callback = null, $empty_view = null, $page = 1, $limit = 5, $filter = false, $hits = false, $slug = true) {
310 310
     if ($view == null || $empty_view == null) $this->ci->load->bind("francis94c/blog", $blogger);
311 311
     $posts = $this->getPosts($page, $limit, $filter, $hits);
312 312
     if (count($posts) == 0) {
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
    * @param  boolean $filter [description]
333 333
    * @return [type]          [description]
334 334
    */
335
-  public function getRecentPosts($limit=5, $filter=false) {
335
+  public function getRecentPosts($limit = 5, $filter = false) {
336 336
     return $this->ci->bmanager->getRecentPosts($limit, $filter);
337 337
   }
338 338
   /**
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
    * @param  [type] $view [description]
342 342
    * @return [type]       [description]
343 343
    */
344
-  public function renderPost($post, $view=null) {
344
+  public function renderPost($post, $view = null) {
345 345
     if (!is_array($post)) $post = $this->ci->bmanager->getPost($post);
346 346
     if (!$post) return false;
347 347
     $post["content"] = $this->ci->parsedown->text($post["content"]);
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
    * @param  [type] $postId [description]
378 378
    * @return [type]         [description]
379 379
    */
380
-  public function getPost($postId, $hit=true) {
380
+  public function getPost($postId, $hit = true) {
381 381
     return $this->ci->bmanager->getPost($postId, $hit);
382 382
   }
383 383
   /**
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
    * @param  boolean $filter [description]
414 414
    * @return [type]          [description]
415 415
    */
416
-  public function searchPosts($words, $page, $limit=0, $filter=false) {
416
+  public function searchPosts($words, $page, $limit = 0, $filter = false) {
417 417
     return $this->ci->bmanager->searchPosts($words, $page, $limit, $filter);
418 418
   }
419 419
 }
Please login to merge, or discard this patch.