Completed
Push — master ( 568f05...8c1715 )
by Angus
05:16 queued 02:33
created
application/models/Tracker/Tracker_Title_Model.php 2 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -15,11 +15,11 @@  discard block
 block discarded – undo
15 15
 	 */
16 16
 	public function getID(string $titleURL, int $siteID, bool $create = TRUE, bool $returnData = FALSE) {
17 17
 		$query = $this->db->select('tracker_titles.id, tracker_titles.title, tracker_titles.title_url, tracker_titles.latest_chapter, tracker_titles.status, tracker_sites.site_class, (tracker_titles.last_checked > DATE_SUB(NOW(), INTERVAL 3 DAY)) AS active', FALSE)
18
-		                  ->from('tracker_titles')
19
-		                  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
20
-		                  ->where('tracker_titles.title_url', $titleURL)
21
-		                  ->where('tracker_titles.site_id', $siteID)
22
-		                  ->get();
18
+						  ->from('tracker_titles')
19
+						  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
20
+						  ->where('tracker_titles.title_url', $titleURL)
21
+						  ->where('tracker_titles.site_id', $siteID)
22
+						  ->get();
23 23
 
24 24
 		if($query->num_rows() > 0) {
25 25
 			$id = (int) $query->row('id');
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
 						//Make sure last_checked is always updated on successful run.
33 33
 						//CHECK: Is there a reason we aren't just doing this in updateTitleById?
34 34
 						$this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE)
35
-						         ->where('id', $id)
36
-						         ->update('tracker_titles');
35
+								 ->where('id', $id)
36
+								 ->update('tracker_titles');
37 37
 					}
38 38
 				} else {
39 39
 					log_message('error', "{$query->row('title')} failed to update successfully");
@@ -73,9 +73,9 @@  discard block
 block discarded – undo
73 73
 	 */
74 74
 	private function addTitle(string $titleURL, int $siteID) : int {
75 75
 		$query = $this->db->select('site, site_class')
76
-		                  ->from('tracker_sites')
77
-		                  ->where('id', $siteID)
78
-		                  ->get();
76
+						  ->from('tracker_sites')
77
+						  ->where('id', $siteID)
78
+						  ->get();
79 79
 
80 80
 		$titleData = $this->sites->{$query->row()->site_class}->getTitleData($titleURL, TRUE);
81 81
 
@@ -101,14 +101,14 @@  discard block
 block discarded – undo
101 101
 	public function updateByID(int $titleID, string $latestChapter) : bool {
102 102
 		//FIXME: Really not too happy with how we're doing history stuff here, it just feels messy.
103 103
 		$query = $this->db->select('latest_chapter AS current_chapter')
104
-		                  ->from('tracker_titles')
105
-		                  ->where('id', $titleID)
106
-		                  ->get();
104
+						  ->from('tracker_titles')
105
+						  ->where('id', $titleID)
106
+						  ->get();
107 107
 		$row = $query->row();
108 108
 
109 109
 		$success = $this->db->set(['latest_chapter' => $latestChapter]) //last_updated gets updated via a trigger if something changes
110
-		                    ->where('id', $titleID)
111
-		                    ->update('tracker_titles');
110
+							->where('id', $titleID)
111
+							->update('tracker_titles');
112 112
 
113 113
 		//Update History
114 114
 		//NOTE: To avoid doing another query to grab the last_updated time, we just use time() which <should> get the same thing.
@@ -126,9 +126,9 @@  discard block
 block discarded – undo
126 126
 	 */
127 127
 	public function getSiteDataFromURL(string $site_url) : ?stdClass {
128 128
 		$query = $this->db->select('*')
129
-		                  ->from('tracker_sites')
130
-		                  ->where('site', $site_url)
131
-		                  ->get();
129
+						  ->from('tracker_sites')
130
+						  ->where('site', $site_url)
131
+						  ->get();
132 132
 
133 133
 		return $query->row();
134 134
 	}
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed');
1
+<?php declare(strict_types = 1); defined('BASEPATH') OR exit('No direct script access allowed');
2 2
 
3 3
 class Tracker_Title_Model extends Tracker_Base_Model {
4 4
 	public function __construct() {
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 	 *
125 125
 	 * @return stdClass|null
126 126
 	 */
127
-	public function getSiteDataFromURL(string $site_url) : ?stdClass {
127
+	public function getSiteDataFromURL(string $site_url) : ? stdClass {
128 128
 		$query = $this->db->select('*')
129 129
 		                  ->from('tracker_sites')
130 130
 		                  ->where('site', $site_url)
Please login to merge, or discard this patch.