Completed
Push — master ( 5d7f0a...75aa15 )
by Angus
07:35
created
public/index.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -210,10 +210,10 @@
 block discarded – undo
210 210
 {
211 211
 	// Ensure there's a trailing slash
212 212
 	$system_path = strtr(
213
-		               rtrim($system_path, '/\\'),
214
-		               '/\\',
215
-		               DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
216
-	               ).DIRECTORY_SEPARATOR;
213
+					   rtrim($system_path, '/\\'),
214
+					   '/\\',
215
+					   DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
216
+				   ).DIRECTORY_SEPARATOR;
217 217
 }
218 218
 
219 219
 // Is the system path correct?
Please login to merge, or discard this patch.
application/libraries/MY_DB_cache.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -245,7 +245,7 @@
 block discarded – undo
245 245
 	}
246 246
 
247 247
 	/**
248
-	 * @param $md5
248
+	 * @param string $md5
249 249
 	 *
250 250
 	 * @return array
251 251
 	 */
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Tag_Model.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@
 block discarded – undo
9 9
 		$success = FALSE;
10 10
 		if(preg_match("/^[a-z0-9\\-_,:]{0,255}$/", $tag_string)) {
11 11
 			$success = (bool) $this->db->set(['tags' => $tag_string, 'active' => 'Y', 'last_updated' => NULL])
12
-			                           ->where('user_id', $userID)
13
-			                           ->where('id', $chapterID)
14
-			                           ->update('tracker_chapters');
12
+									   ->where('user_id', $userID)
13
+									   ->where('id', $chapterID)
14
+									   ->update('tracker_chapters');
15 15
 		}
16 16
 
17 17
 		if($success) {
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Category_Model.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,9 +7,9 @@  discard block
 block discarded – undo
7 7
 
8 8
 	public function setByID(int $userID, int $chapterID, string $category) : bool {
9 9
 		$success = $this->db->set(['category' => $category, 'active' => 'Y', 'last_updated' => NULL])
10
-		                    ->where('user_id', $userID)
11
-		                    ->where('id', $chapterID)
12
-		                    ->update('tracker_chapters');
10
+							->where('user_id', $userID)
11
+							->where('id', $chapterID)
12
+							->update('tracker_chapters');
13 13
 
14 14
 		return (bool) $success;
15 15
 	}
@@ -40,11 +40,11 @@  discard block
 block discarded – undo
40 40
 
41 41
 	public function getUsed(int $userID) : array {
42 42
 		$query = $this->db->distinct()
43
-		                  ->select('category')
44
-		                  ->from('tracker_chapters')
45
-		                  ->where('tracker_chapters.active', 'Y')
46
-		                  ->where('user_id', $userID)
47
-		                  ->get();
43
+						  ->select('category')
44
+						  ->from('tracker_chapters')
45
+						  ->where('tracker_chapters.active', 'Y')
46
+						  ->where('user_id', $userID)
47
+						  ->get();
48 48
 
49 49
 		return array_column($query->result_array(), 'category');
50 50
 	}
Please login to merge, or discard this patch.
application/models/User_Options_Model.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@
 block discarded – undo
114 114
 	 * @param string   $option
115 115
 	 * @param int|null $userID
116 116
 	 *
117
-	 * @return mixed Returns option value as STRING, or FALSE if option does not exist.
117
+	 * @return string Returns option value as STRING, or FALSE if option does not exist.
118 118
 	 */
119 119
 	public function get(string $option, ?int $userID = NULL) {
120 120
 		$userID = (is_null($userID) ? (int) $this->User->id : $userID);
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -188,18 +188,18 @@
 block discarded – undo
188 188
 		//FIXME: Query duplication.
189 189
 		if($this->User->id !== $userID) {
190 190
 			$query = $this->db->select('value_str, value_int')
191
-			                  ->from('user_options')
192
-			                  ->where('user_id', $userID)
193
-			                  ->where('name',    $option)
194
-			                  ->limit(1);
191
+							  ->from('user_options')
192
+							  ->where('user_id', $userID)
193
+							  ->where('name',    $option)
194
+							  ->limit(1);
195 195
 			$data = $query->get()->row_array();
196 196
 		} else {
197 197
 			if(!($data = $this->session->tempdata("option_{$option}"))) {
198 198
 				$query = $this->db->select('value_str, value_int')
199
-				                  ->from('user_options')
200
-				                  ->where('user_id', $userID)
201
-				                  ->where('name',    $option)
202
-				                  ->limit(1);
199
+								  ->from('user_options')
200
+								  ->where('user_id', $userID)
201
+								  ->where('name',    $option)
202
+								  ->limit(1);
203 203
 				$data = $query->get()->row_array();
204 204
 				$this->session->set_tempdata("option_{$option}", $data, 3600);
205 205
 			}
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Title_Model.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@
 block discarded – undo
122 122
 	/**
123 123
 	 * @param string $site_url
124 124
 	 *
125
-	 * @return stdClass|object|null
125
+	 * @return string
126 126
 	 */
127 127
 	public function getSiteDataFromURL(string $site_url) {
128 128
 		$query = $this->db->select('*')
Please login to merge, or discard this patch.
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -17,11 +17,11 @@  discard block
 block discarded – undo
17 17
 	 */
18 18
 	public function getID(string $titleURL, int $siteID, bool $create = TRUE, bool $returnData = FALSE) {
19 19
 		$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)
20
-		                  ->from('tracker_titles')
21
-		                  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
22
-		                  ->where('tracker_titles.title_url', $titleURL)
23
-		                  ->where('tracker_titles.site_id', $siteID)
24
-		                  ->get();
20
+						  ->from('tracker_titles')
21
+						  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
22
+						  ->where('tracker_titles.title_url', $titleURL)
23
+						  ->where('tracker_titles.site_id', $siteID)
24
+						  ->get();
25 25
 
26 26
 		if($query->num_rows() > 0) {
27 27
 			$id = (int) $query->row('id');
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
 						//Make sure last_checked is always updated on successful run.
36 36
 						//CHECK: Is there a reason we aren't just doing this in updateTitleById?
37 37
 						$this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE)
38
-						         ->where('id', $id)
39
-						         ->update('tracker_titles');
38
+								 ->where('id', $id)
39
+								 ->update('tracker_titles');
40 40
 					}
41 41
 				} else {
42 42
 					log_message('error', "{$siteClass} | {$query->row('title')} ({$query->row('title_url')}) | Failed to update.");
@@ -76,9 +76,9 @@  discard block
 block discarded – undo
76 76
 	 */
77 77
 	private function addTitle(string $titleURL, int $siteID) : int {
78 78
 		$query = $this->db->select('site, site_class')
79
-		                  ->from('tracker_sites')
80
-		                  ->where('id', $siteID)
81
-		                  ->get();
79
+						  ->from('tracker_sites')
80
+						  ->where('id', $siteID)
81
+						  ->get();
82 82
 
83 83
 		$titleData = $this->sites->{$query->row()->site_class}->getTitleData($titleURL, TRUE);
84 84
 
@@ -104,21 +104,21 @@  discard block
 block discarded – undo
104 104
 	public function updateByID(int $titleID, ?string $latestChapter) : bool {
105 105
 		//FIXME: Really not too happy with how we're doing history stuff here, it just feels messy.
106 106
 		$query = $this->db->select('latest_chapter AS current_chapter')
107
-		                  ->from('tracker_titles')
108
-		                  ->where('id', $titleID)
109
-		                  ->get();
107
+						  ->from('tracker_titles')
108
+						  ->where('id', $titleID)
109
+						  ->get();
110 110
 		$row = $query->row();
111 111
 
112 112
 		//TODO (CHECK): If failed_checks changes won't that trigger affected_rows?
113 113
 		$success = $this->db->set(['latest_chapter' => $latestChapter, 'failed_checks' => 0]) //last_updated gets updated via a trigger if something changes
114
-		                    ->where('id', $titleID)
115
-		                    ->update('tracker_titles');
114
+							->where('id', $titleID)
115
+							->update('tracker_titles');
116 116
 
117 117
 		if($this->db->affected_rows() > 0) {
118 118
 			//Clear hidden latest chapter
119 119
 			$this->db->set(['ignore_chapter' => 'NULL', 'last_updated' => 'last_updated'], NULL, FALSE)
120
-			         ->where('title_id', $titleID)
121
-			         ->update('tracker_chapters');
120
+					 ->where('title_id', $titleID)
121
+					 ->update('tracker_chapters');
122 122
 		}
123 123
 
124 124
 		//Update History
@@ -135,20 +135,20 @@  discard block
 block discarded – undo
135 135
 		if(!array_diff(array_keys($data), TITLEDATA_COLUMNS)) {
136 136
 			$newData = array_merge($data, ['failed_checks' => 0]);
137 137
 			$oldData = $this->db->select('latest_chapter AS current_chapter')
138
-			                    ->from('tracker_titles')
139
-			                    ->where('id', $titleID)
140
-			                    ->get()->row_array();
138
+								->from('tracker_titles')
139
+								->where('id', $titleID)
140
+								->get()->row_array();
141 141
 
142 142
 
143 143
 			$success = $this->db->set($newData) //last_updated gets updated via a trigger if something changes
144
-			                    ->set('last_checked', 'CURRENT_TIMESTAMP', FALSE)
145
-			                    ->where('id', $titleID)
146
-			                    ->update('tracker_titles');
144
+								->set('last_checked', 'CURRENT_TIMESTAMP', FALSE)
145
+								->where('id', $titleID)
146
+								->update('tracker_titles');
147 147
 			if(in_array('latest_chapter', $newData, TRUE) && $newData['latest_chapter'] !== $oldData['current_chapter'] && $this->db->affected_rows() > 0) {
148 148
 				//Clear hidden latest chapter
149 149
 				$this->db->set(['ignore_chapter' => 'NULL', 'last_updated' => 'last_updated'], NULL, FALSE)
150
-				         ->where('title_id', $titleID)
151
-				         ->update('tracker_chapters');
150
+						 ->where('title_id', $titleID)
151
+						 ->update('tracker_chapters');
152 152
 			}
153 153
 
154 154
 			//Update History
@@ -164,8 +164,8 @@  discard block
 block discarded – undo
164 164
 
165 165
 	public function updateFailedChecksByID(int $titleID) : bool {
166 166
 		$success = $this->db->set('failed_checks', 'failed_checks + 1', FALSE)
167
-		                    ->where('id', $titleID)
168
-		                    ->update('tracker_titles');
167
+							->where('id', $titleID)
168
+							->update('tracker_titles');
169 169
 
170 170
 		return $success;
171 171
 	}
@@ -177,9 +177,9 @@  discard block
 block discarded – undo
177 177
 	 */
178 178
 	public function getSiteDataFromURL(string $site_url) {
179 179
 		$query = $this->db->select('*')
180
-		                  ->from('tracker_sites')
181
-		                  ->where('site', $site_url)
182
-		                  ->get();
180
+						  ->from('tracker_sites')
181
+						  ->where('site', $site_url)
182
+						  ->get();
183 183
 
184 184
 		return $query->row();
185 185
 	}
Please login to merge, or discard this patch.
application/controllers/AdminPanel.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,12 +40,12 @@
 block discarded – undo
40 40
 
41 41
 	private function _list_complete_titles() {
42 42
 		$query = $this->db->select('tracker_titles.id, tracker_sites.site_class, tracker_titles.title, tracker_titles.title_url')
43
-		                  ->from('tracker_chapters')
44
-		                  ->join('tracker_titles', 'tracker_chapters.title_id = tracker_titles.id', 'left')
45
-		                  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
46
-		                  ->like('tracker_chapters.tags', 'complete')
47
-		                  ->where('tracker_titles.status', 0)
48
-		                  ->get();
43
+						  ->from('tracker_chapters')
44
+						  ->join('tracker_titles', 'tracker_chapters.title_id = tracker_titles.id', 'left')
45
+						  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
46
+						  ->like('tracker_chapters.tags', 'complete')
47
+						  ->where('tracker_titles.status', 0)
48
+						  ->get();
49 49
 
50 50
 		$completeList = [];
51 51
 		if($query->num_rows() > 0) {
Please login to merge, or discard this patch.
application/controllers/Ajax/Userscript.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,9 +53,9 @@
 block discarded – undo
53 53
 				];
54 54
 
55 55
 				$this->output
56
-				     ->set_status_header('200')
57
-				     ->set_content_type('application/json', 'utf-8')
58
-				     ->set_output(json_encode($json));
56
+					 ->set_status_header('200')
57
+					 ->set_content_type('application/json', 'utf-8')
58
+					 ->set_output(json_encode($json));
59 59
 			} else {
60 60
 				//TODO: We should probably try and have more verbose errors here. Return via JSON or something.
61 61
 				$this->output->set_status_header('400', 'Unable to update?');
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_List_Model.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -203,14 +203,14 @@  discard block
 block discarded – undo
203 203
 			}
204 204
 
205 205
 			$idQuery = $this->db->select('id')
206
-			                    ->where('user_id', $userID)
207
-			                    ->where('title_id', $titleID)
208
-			                    ->get('tracker_chapters');
206
+								->where('user_id', $userID)
207
+								->where('title_id', $titleID)
208
+								->get('tracker_chapters');
209 209
 			if($idQuery->num_rows() > 0) {
210 210
 				$success = (bool) $this->db->set(['current_chapter' => $chapter, 'active' => 'Y', 'last_updated' => NULL, 'ignore_chapter' => NULL])
211
-				                           ->where('user_id', $userID)
212
-				                           ->where('title_id', $titleID)
213
-				                           ->update('tracker_chapters');
211
+										   ->where('user_id', $userID)
212
+										   ->where('title_id', $titleID)
213
+										   ->update('tracker_chapters');
214 214
 
215 215
 				if($success) {
216 216
 					$idQueryRow = $idQuery->row();
@@ -236,9 +236,9 @@  discard block
 block discarded – undo
236 236
 	}
237 237
 	public function updateByID(int $userID, int $chapterID, string $chapter) : bool {
238 238
 		$success = (bool) $this->db->set(['current_chapter' => $chapter, 'active' => 'Y', 'last_updated' => NULL])
239
-		                           ->where('user_id', $userID)
240
-		                           ->where('id', $chapterID)
241
-		                           ->update('tracker_chapters');
239
+								   ->where('user_id', $userID)
240
+								   ->where('id', $chapterID)
241
+								   ->update('tracker_chapters');
242 242
 
243 243
 		if($success) {
244 244
 			$this->History->userUpdateTitle($chapterID, $chapter);
@@ -248,9 +248,9 @@  discard block
 block discarded – undo
248 248
 
249 249
 	public function ignoreByID(int $userID, int $chapterID, string $chapter) : bool {
250 250
 		$success = (bool) $this->db->set(['ignore_chapter' => $chapter, 'active' => 'Y', 'last_updated' => NULL])
251
-		                           ->where('user_id', $userID)
252
-		                           ->where('id', $chapterID)
253
-		                           ->update('tracker_chapters');
251
+								   ->where('user_id', $userID)
252
+								   ->where('id', $chapterID)
253
+								   ->update('tracker_chapters');
254 254
 
255 255
 		if($success) {
256 256
 			$this->History->userIgnoreTitle($chapterID, $chapter);
@@ -263,9 +263,9 @@  discard block
 block discarded – undo
263 263
 		//This is to allow user history to function properly.
264 264
 
265 265
 		$success = $this->db->set(['active' => 'N', 'last_updated' => NULL])
266
-		                    ->where('user_id', $userID)
267
-		                    ->where('id', $chapterID)
268
-		                    ->update('tracker_chapters');
266
+							->where('user_id', $userID)
267
+							->where('id', $chapterID)
268
+							->update('tracker_chapters');
269 269
 
270 270
 		return (bool) $success;
271 271
 	}
@@ -295,10 +295,10 @@  discard block
 block discarded – undo
295 295
 		//TODO: OPTION, USE BACKEND MAL ID DB WHERE POSSIBLE (DEFAULT TRUE)
296 296
 
297 297
 		$queryC = $this->db->select('mal_id')
298
-		                   ->where('user_id', $userID)
299
-		                   ->where('title_id', $titleID)
300
-		                   ->where('mal_id IS NOT NULL', NULL, FALSE)
301
-		                   ->get('tracker_chapters');
298
+						   ->where('user_id', $userID)
299
+						   ->where('title_id', $titleID)
300
+						   ->where('mal_id IS NOT NULL', NULL, FALSE)
301
+						   ->get('tracker_chapters');
302 302
 
303 303
 		if($queryC->num_rows() > 0 && ($rowC = $queryC->row())) {
304 304
 			$malIDArr = [
@@ -307,8 +307,8 @@  discard block
 block discarded – undo
307 307
 			];
308 308
 		} else {
309 309
 			$queryT = $this->db->select('mal_id')
310
-			                   ->where('id', $titleID)
311
-			                   ->get('tracker_titles');
310
+							   ->where('id', $titleID)
311
+							   ->get('tracker_titles');
312 312
 
313 313
 			if($queryT->num_rows() > 0 && ($rowT = $queryT->row())) {
314 314
 				$malIDArr = [
@@ -341,9 +341,9 @@  discard block
 block discarded – undo
341 341
 	public function setMalID(int $userID, int $chapterID, ?int $malID) : bool {
342 342
 		//TODO: Handle NULL?
343 343
 		$success = (bool) $this->db->set(['mal_id' => $malID, 'active' => 'Y', 'last_updated' => NULL])
344
-		                           ->where('user_id', $userID)
345
-		                           ->where('id', $chapterID)
346
-		                           ->update('tracker_chapters');
344
+								   ->where('user_id', $userID)
345
+								   ->where('id', $chapterID)
346
+								   ->update('tracker_chapters');
347 347
 
348 348
 		if($success) {
349 349
 			//MAL id update was successful, update history
Please login to merge, or discard this patch.