@@ -14,7 +14,7 @@ |
||
14 | 14 | * Prerquisites for the Unit Tests. |
15 | 15 | */ |
16 | 16 | public static function setUpBeforeClass(): void { |
17 | - self::$ci =& get_instance(); |
|
17 | + self::$ci = & get_instance(); |
|
18 | 18 | self::$ci->load->database('mysqli://root@localhost/test_db'); |
19 | 19 | $queries = [ |
20 | 20 | "CREATE TABLE IF NOT EXISTS admins (id INT(7) AUTO_INCREMENT PRIMARY KEY, name VARCHAR(20) NOT NULL, password TEXT NOT NULL) Engine=InnoDB;", |
@@ -69,8 +69,8 @@ discard block |
||
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 =& get_instance(); |
|
72 | + function __construct($params = null) { |
|
73 | + $this->ci = & 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(); |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * |
94 | 94 | * @return bool True on Success, False if Not. |
95 | 95 | */ |
96 | - public function install(string $blogName=null, string $adminTableName=null, string $adminIdColumnName=null, int $adminIdColumnConstraint=null): bool { |
|
96 | + public function install(string $blogName = null, string $adminTableName = null, string $adminIdColumnName = null, int $adminIdColumnConstraint = null): bool { |
|
97 | 97 | $blogName = $blogName == null ? $this->table_name : self::TABLE_PREFIX . "_" . $blogName; |
98 | 98 | $this->ci->load->dbforge(); |
99 | 99 | $this->ci->dbforge->add_field("id"); |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | * @param boolean $w3css [description] |
196 | 196 | * @return [type] [description] |
197 | 197 | */ |
198 | - public function loadEditor($callback, $postId=null, $w3css=true) { |
|
198 | + public function loadEditor($callback, $postId = null, $w3css = true) { |
|
199 | 199 | $this->loadScripts($w3css); |
200 | 200 | $this->ci->load->helper("form"); |
201 | 201 | $data = array( |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | * @param [type] $posterId [description] |
218 | 218 | * @return [type] [description] |
219 | 219 | */ |
220 | - public function savePost($posterId=null) { |
|
220 | + public function savePost($posterId = null) { |
|
221 | 221 | $action = $this->ci->security->xss_clean($this->ci->input->post("action")); |
222 | 222 | if ($action == "save") { |
223 | 223 | $id = $this->ci->security->xss_clean($this->ci->input->post("id")); |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | * return all posts. false by default. |
256 | 256 | * @return array Array of posts for a given page. |
257 | 257 | */ |
258 | - public function getPosts($page, $limit, $filter=false, $hits=false) { |
|
258 | + public function getPosts($page, $limit, $filter = false, $hits = false) { |
|
259 | 259 | return $this->ci->bmanager->getPosts($page, $limit, $filter, $hits); |
260 | 260 | } |
261 | 261 | /** |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | * @param boolean $hits [description] |
269 | 269 | * @return [type] [description] |
270 | 270 | */ |
271 | - public function renderPostItems($view=null, $callback=null, $empty_view=null, $page=1, $limit=5, $filter=false, $hits=false, $slug=true) { |
|
271 | + public function renderPostItems($view = null, $callback = null, $empty_view = null, $page = 1, $limit = 5, $filter = false, $hits = false, $slug = true) { |
|
272 | 272 | if ($view == null || $empty_view == null) $this->ci->load->bind("francis94c/blog", $blogger); |
273 | 273 | $posts = $this->getPosts($page, $limit, $filter, $hits); |
274 | 274 | if (count($posts) == 0) { |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | * @param boolean $filter [description] |
295 | 295 | * @return [type] [description] |
296 | 296 | */ |
297 | - public function getRecentPosts($limit=5, $filter=false) { |
|
297 | + public function getRecentPosts($limit = 5, $filter = false) { |
|
298 | 298 | return $this->ci->bmanager->getRecentPosts($limit, $filter); |
299 | 299 | } |
300 | 300 | /** |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | * @param [type] $view [description] |
304 | 304 | * @return [type] [description] |
305 | 305 | */ |
306 | - public function renderPost($post, $view=null) { |
|
306 | + public function renderPost($post, $view = null) { |
|
307 | 307 | if (!is_array($post)) $post = $this->ci->bmanager->getPost($post); |
308 | 308 | if (!$post) return false; |
309 | 309 | $post["content"] = $this->ci->parsedown->text($post["content"]); |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | * @param [type] $postId [description] |
340 | 340 | * @return [type] [description] |
341 | 341 | */ |
342 | - public function getPost($postId, $hit=true) { |
|
342 | + public function getPost($postId, $hit = true) { |
|
343 | 343 | return $this->ci->bmanager->getPost($postId, $hit); |
344 | 344 | } |
345 | 345 | /** |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | * @param boolean $filter [description] |
376 | 376 | * @return [type] [description] |
377 | 377 | */ |
378 | - public function searchPosts($words, $page, $limit=0, $filter=false) { |
|
378 | + public function searchPosts($words, $page, $limit = 0, $filter = false) { |
|
379 | 379 | return $this->ci->bmanager->searchPosts($words, $page, $limit, $filter); |
380 | 380 | } |
381 | 381 | } |