Completed
Push — master ( c906e8...477aa2 )
by Angus
08:31
created
application/models/Tracker/Tracker_Favourites_Model.php 3 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 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_Favourites_Model extends Tracker_Base_Model {
4 4
 	public function __construct() {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@  discard block
 block discarded – undo
14 14
 			          tf.chapter, tf.page, tf.updated_at', FALSE)
15 15
 			->from('tracker_favourites AS tf')
16 16
 			->join('tracker_chapters AS tc', 'tf.chapter_id = tc.id', 'left')
17
-			->join('tracker_titles AS tt',   'tc.title_id = tt.id',   'left')
18
-			->join('tracker_sites AS ts',    'tt.site_id = ts.id',    'left')
17
+			->join('tracker_titles AS tt', 'tc.title_id = tt.id', 'left')
18
+			->join('tracker_sites AS ts', 'tt.site_id = ts.id', 'left')
19 19
 			->where('tc.user_id', $this->User->id) //CHECK: Is this inefficient? Would it be better to have a user_id column in tracker_favourites?
20 20
 			->order_by('tf.id DESC')
21 21
 			->limit($rowsPerPage, ($rowsPerPage * ($page - 1)))
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
 			          tf.chapter, tf.page, tf.updated_at', FALSE)
58 58
 			->from('tracker_favourites AS tf')
59 59
 			->join('tracker_chapters AS tc', 'tf.chapter_id = tc.id', 'left')
60
-			->join('tracker_titles AS tt',   'tc.title_id = tt.id',   'left')
61
-			->join('tracker_sites AS ts',    'tt.site_id = ts.id',    'left')
60
+			->join('tracker_titles AS tt', 'tc.title_id = tt.id', 'left')
61
+			->join('tracker_sites AS ts', 'tt.site_id = ts.id', 'left')
62 62
 			->where('tc.user_id', $this->User->id) //CHECK: Is this inefficient? Would it be better to have a user_id column in tracker_favourites?
63 63
 			->order_by('tf.id DESC')
64 64
 			->get();
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 
146 146
 						if($isSuccess) {
147 147
 							$success = array(
148
-								'status' => 'Unfavourited' . ($page ? " page {$page}" : ''),
148
+								'status' => 'Unfavourited'.($page ? " page {$page}" : ''),
149 149
 								'bool'   => TRUE
150 150
 							);
151 151
 							$this->History->userRemoveFavourite((int) $idCQueryRow->id, $chapter);
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 
168 168
 					if($isSuccess) {
169 169
 						$success = array(
170
-							'status' => 'Favourited' . ($page ? " page {$page}" : ''),
170
+							'status' => 'Favourited'.($page ? " page {$page}" : ''),
171 171
 							'bool'   => TRUE
172 172
 						);
173 173
 						$this->History->userAddFavourite((int) $idCQueryRow->id, $chapter);
Please login to merge, or discard this patch.
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -115,34 +115,34 @@
 block discarded – undo
115 115
 
116 116
 			////We need the series to be tracked
117 117
 			$idCQuery = $this->db->select('id')
118
-			                     ->where('user_id', $userID)
119
-			                     ->where('title_id', $titleID)
120
-			                     ->get('tracker_chapters');
118
+								 ->where('user_id', $userID)
119
+								 ->where('title_id', $titleID)
120
+								 ->get('tracker_chapters');
121 121
 			if(!($idCQuery->num_rows() > 0)) {
122 122
 				//NOTE: This pretty much repeats a lot of what we already did above. Is there a better way to do this?
123 123
 				$this->Tracker->list->update($userID, $site, $title, $chapter, FALSE);
124 124
 
125 125
 				$idCQuery = $this->db->select('id')
126
-				                     ->where('user_id', $userID)
127
-				                     ->where('title_id', $titleID)
128
-				                     ->get('tracker_chapters');
126
+									 ->where('user_id', $userID)
127
+									 ->where('title_id', $titleID)
128
+									 ->get('tracker_chapters');
129 129
 			}
130 130
 			if($idCQuery->num_rows() > 0) {
131 131
 				$idCQueryRow = $idCQuery->row();
132 132
 
133 133
 				//Check if it is already favourited
134 134
 				$idFQuery = $this->db->select('id')
135
-				                     ->where('chapter_id', $idCQueryRow->id)
136
-				                     ->where('chapter', $chapter)
137
-				                     ->where('page', $page)
138
-				                     ->get('tracker_favourites');
135
+									 ->where('chapter_id', $idCQueryRow->id)
136
+									 ->where('chapter', $chapter)
137
+									 ->where('page', $page)
138
+									 ->get('tracker_favourites');
139 139
 				if($idFQuery->num_rows() > 0) {
140 140
 					//Chapter is already favourited, so remove it from DB
141 141
 					if($removeIfExists) {
142 142
 						$idFQueryRow = $idFQuery->row();
143 143
 
144 144
 						$isSuccess = (bool) $this->db->where('id', $idFQueryRow->id)
145
-						                             ->delete('tracker_favourites');
145
+													 ->delete('tracker_favourites');
146 146
 
147 147
 						if($isSuccess) {
148 148
 							$success = array(
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Base_Model.php 2 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 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_Base_Model extends CI_Model {
4 4
 	public $sites;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 			$this->enabledCategories['custom3'] = $this->User_Options->get('category_custom_3_text');
27 27
 		}
28 28
 
29
-		foreach (glob(APPPATH.'models/Tracker/Sites/*.php') as $filename) {
29
+		foreach(glob(APPPATH.'models/Tracker/Sites/*.php') as $filename) {
30 30
 			/** @noinspection PhpIncludeInspection */
31 31
 			include_once $filename;
32 32
 		}
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Admin_Model.php 4 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 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_Admin_Model extends Tracker_Base_Model {
4 4
 	public function __construct() {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -79,8 +79,8 @@  discard block
 block discarded – undo
79 79
 		if($query->num_rows() > 0) {
80 80
 			$hardRateLimit  = 500; //This is to avoid any possible IP bans by cache breaking again.
81 81
 			$siteRateLimits = [];
82
-			foreach ($query->result() as $row) {
83
-				if(!array_key_exists($row->site_class,$siteRateLimits)) {
82
+			foreach($query->result() as $row) {
83
+				if(!array_key_exists($row->site_class, $siteRateLimits)) {
84 84
 					$siteRateLimits[$row->site_class] = 0;
85 85
 				}
86 86
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 		$query = $query->get();
149 149
 
150 150
 		if($query->num_rows() > 0) {
151
-			foreach ($query->result() as $row) {
151
+			foreach($query->result() as $row) {
152 152
 				$this->handleUpdate($row);
153 153
 			}
154 154
 		}
@@ -226,10 +226,10 @@  discard block
 block discarded – undo
226 226
 		                  ->get();
227 227
 
228 228
 		$sites = $query->result_array();
229
-		foreach ($sites as $site) {
229
+		foreach($sites as $site) {
230 230
 			$siteClass = $this->sites->{$site['site_class']};
231 231
 			if($titleDataList = $siteClass->doCustomUpdate()) {
232
-				foreach ($titleDataList as $titleURL => $titleData) {
232
+				foreach($titleDataList as $titleURL => $titleData) {
233 233
 					$titleURL = (string) $titleURL; //Number only keys get converted to int for some reason, so we need to fix that.
234 234
 					print "> {$titleData['title']} <{$site['site_class']}>"; //Print this prior to doing anything so we can more easily find out if something went wrong
235 235
 					if(is_array($titleData) && !is_null($titleData['latest_chapter'])) {
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 		$query = $this->db->select('tracker_titles.id, tracker_titles.title_url, tracker_sites.site_class')
273 273
 		                  ->from('tracker_titles')
274 274
 		                  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
275
-		                  ->where('tracker_titles.followed','N')
275
+		                  ->where('tracker_titles.followed', 'N')
276 276
 		                  ->where('tracker_titles !=', '255')
277 277
 		                  ->where('tracker_sites.status', 'enabled')
278 278
 		                  ->where('tracker_sites.use_custom', 'Y')
Please login to merge, or discard this patch.
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -223,10 +223,10 @@  discard block
 block discarded – undo
223 223
 	 */
224 224
 	public function updateCustom() {
225 225
 		$query = $this->db->select('*')
226
-		                  ->from('tracker_sites')
227
-		                  ->where('tracker_sites.status', 'enabled')
228
-		                  ->where('tracker_sites.use_custom', 'Y')
229
-		                  ->get();
226
+						  ->from('tracker_sites')
227
+						  ->where('tracker_sites.status', 'enabled')
228
+						  ->where('tracker_sites.use_custom', 'Y')
229
+						  ->get();
230 230
 
231 231
 		$sites = $query->result_array();
232 232
 		foreach ($sites as $site) {
@@ -243,8 +243,8 @@  discard block
 block discarded – undo
243 243
 									//Make sure last_checked is always updated on successful run.
244 244
 									//CHECK: Is there a reason we aren't just doing this in updateByID?
245 245
 									$this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE)
246
-									         ->where('id', $titleID)
247
-									         ->update('tracker_titles');
246
+											 ->where('id', $titleID)
247
+											 ->update('tracker_titles');
248 248
 
249 249
 									print " - ({$titleData['latest_chapter']})\n";
250 250
 								} else {
@@ -273,13 +273,13 @@  discard block
 block discarded – undo
273 273
 
274 274
 	public function refollowCustom() {
275 275
 		$query = $this->db->select('tracker_titles.id, tracker_titles.title_url, tracker_sites.site_class')
276
-		                  ->from('tracker_titles')
277
-		                  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
278
-		                  ->where('tracker_titles.followed','N')
279
-		                  ->where('tracker_titles !=', '255')
280
-		                  ->where('tracker_sites.status', 'enabled')
281
-		                  ->where('tracker_sites.use_custom', 'Y')
282
-		                  ->get();
276
+						  ->from('tracker_titles')
277
+						  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
278
+						  ->where('tracker_titles.followed','N')
279
+						  ->where('tracker_titles !=', '255')
280
+						  ->where('tracker_sites.status', 'enabled')
281
+						  ->where('tracker_sites.use_custom', 'Y')
282
+						  ->get();
283 283
 
284 284
 		if($query->num_rows() > 0) {
285 285
 			foreach($query->result() as $row) {
@@ -290,8 +290,8 @@  discard block
 block discarded – undo
290 290
 
291 291
 					if(!empty($titleData)) {
292 292
 						$this->db->set($titleData)
293
-						         ->where('id', $row->id)
294
-						         ->update('tracker_titles');
293
+								 ->where('id', $row->id)
294
+								 ->update('tracker_titles');
295 295
 
296 296
 						print "> {$row->site_class}:{$row->id}:{$row->title_url} FOLLOWED\n";
297 297
 					} else {
@@ -311,14 +311,14 @@  discard block
 block discarded – undo
311 311
 		$date = $temp_now->format('Y-m-d');
312 312
 
313 313
 		$query = $this->db->select('1')
314
-		                  ->from('site_stats')
315
-		                  ->where('date', $date)
316
-		                  ->get();
314
+						  ->from('site_stats')
315
+						  ->where('date', $date)
316
+						  ->get();
317 317
 
318 318
 		if($query->num_rows() > 0) {
319 319
 			$this->db->set('total_requests', 'total_requests+1', FALSE)
320
-			         ->where('date', $date)
321
-			         ->update('site_stats');
320
+					 ->where('date', $date)
321
+					 ->update('site_stats');
322 322
 		} else {
323 323
 			$this->db->insert('site_stats', [
324 324
 				'date'           => $date,
Please login to merge, or discard this patch.
Braces   +7 added lines, -9 removed lines patch added patch discarded remove patch
@@ -85,7 +85,9 @@  discard block
 block discarded – undo
85 85
 				}
86 86
 
87 87
 				$siteRateLimits[$row->site_class]++;
88
-				if($siteRateLimits[$row->site_class] > $hardRateLimit) continue;
88
+				if($siteRateLimits[$row->site_class] > $hardRateLimit) {
89
+					continue;
90
+				}
89 91
 
90 92
 				usleep(500000); // Delay requests by .5 seconds.
91 93
 				if($siteRateLimits[$row->site_class] > 25) {
@@ -175,8 +177,7 @@  discard block
 block discarded – undo
175 177
 
176 178
 						print " - Something went wrong?\n";
177 179
 					}
178
-				}
179
-				else if(array_key_exists('status', $titleData)) {
180
+				} else if(array_key_exists('status', $titleData)) {
180 181
 					// Series has probably been deleted.
181 182
 
182 183
 					if($this->Tracker->title->updateTitleDataByID((int) $row->title_id, $titleData)) {
@@ -186,8 +187,7 @@  discard block
 block discarded – undo
186 187
 
187 188
 						print " - Something went wrong?\n";
188 189
 					}
189
-				}
190
-				else if($site->canHaveNoChapters) {
190
+				} else if($site->canHaveNoChapters) {
191 191
 					// Previous statements failed, however site can have no chapters.
192 192
 					if($this->Tracker->title->updateTitleDataByID((int) $row->title_id, ['latest_chapter' => NULL])) {
193 193
 						print " - (No chapters found?)\n";
@@ -196,12 +196,10 @@  discard block
 block discarded – undo
196 196
 
197 197
 						print " - Something went wrong?\n";
198 198
 					}
199
-				}
200
-				else {
199
+				} else {
201 200
 					log_message('error', 'handleUpdate failed due to invalid titleData info?');
202 201
 				}
203
-			}
204
-			else {
202
+			} else {
205 203
 				// If TitleData does not exist, either something has broken, or we've set up the site wrong.
206 204
 
207 205
 				//TODO: We should have some way to handle this in the site models.
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_List_Model.php 4 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 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_List_Model extends Tracker_Base_Model {
4 4
 	public function __construct() {
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -114,11 +114,15 @@
 block discarded – undo
114 114
 
115 115
 							if($sortOrder == 'asc') {
116 116
 								$unreadSort = ($a_text <=> $b_text);
117
-								if($unreadSort) return $unreadSort;
117
+								if($unreadSort) {
118
+									return $unreadSort;
119
+								}
118 120
 								return $a_text2 <=> $b_text2;
119 121
 							} else {
120 122
 								$unreadSort = ($a_text <=> $b_text);
121
-								if($unreadSort) return $unreadSort;
123
+								if($unreadSort) {
124
+									return $unreadSort;
125
+								}
122 126
 								return $b_text2 <=> $a_text2;
123 127
 							}
124 128
 						});
Please login to merge, or discard this 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.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -33,13 +33,13 @@  discard block
 block discarded – undo
33 33
 			];
34 34
 		}
35 35
 		if($result->num_rows() > 0) {
36
-			foreach ($result->result() as $row) {
36
+			foreach($result->result() as $row) {
37 37
 				$is_unread = intval((is_null($row->latest_chapter)) || ($row->latest_chapter == $row->ignore_chapter) || ($row->latest_chapter == $row->current_chapter) ? '1' : '0');
38 38
 				$arr['series'][$row->category]['unread_count'] = (($arr['series'][$row->category]['unread_count'] ?? 0) + !$is_unread);
39 39
 				$data = [
40 40
 					'id' => $row->id,
41 41
 					'generated_current_data' => $this->sites->{$row->site_class}->getChapterData($row->title_url, $row->current_chapter),
42
-					'generated_latest_data'  => !is_null($row->latest_chapter) ? $this->sites->{$row->site_class}->getChapterData($row->title_url, $row->latest_chapter) : ['url' => '#', 'number' => 'No chapters found'] ,
42
+					'generated_latest_data'  => !is_null($row->latest_chapter) ? $this->sites->{$row->site_class}->getChapterData($row->title_url, $row->latest_chapter) : ['url' => '#', 'number' => 'No chapters found'],
43 43
 					'generated_ignore_data'  => ($row->ignore_chapter ? $this->sites->{$row->site_class}->getChapterData($row->title_url, $row->ignore_chapter) : NULL),
44 44
 
45 45
 					'full_title_url'        => $this->sites->{$row->site_class}->getFullTitleURL($row->title_url),
@@ -90,8 +90,8 @@  discard block
 block discarded – undo
90 90
 			$sortOrder = $this->User_Options->get('list_sort_order', $userID);
91 91
 			switch($this->User_Options->get('list_sort_type', $userID)) {
92 92
 				case 'unread':
93
-					foreach (array_keys($arr['series']) as $category) {
94
-						usort($arr['series'][$category]['manga'], function ($a, $b) use($sortOrder) {
93
+					foreach(array_keys($arr['series']) as $category) {
94
+						usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) {
95 95
 							$a_text = strtolower("{$a['new_chapter_exists']} - {$a['title_data']['title']}");
96 96
 							$b_text = strtolower("{$b['new_chapter_exists']} - {$b['title_data']['title']}");
97 97
 
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
 					break;
106 106
 
107 107
 				case 'unread_latest':
108
-					foreach (array_keys($arr['series']) as $category) {
109
-						usort($arr['series'][$category]['manga'], function ($a, $b) use($sortOrder) {
108
+					foreach(array_keys($arr['series']) as $category) {
109
+						usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) {
110 110
 							$a_text = $a['new_chapter_exists'];
111 111
 							$b_text = $b['new_chapter_exists'];
112 112
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 					break;
128 128
 
129 129
 				case 'alphabetical':
130
-					foreach (array_keys($arr['series']) as $category) {
130
+					foreach(array_keys($arr['series']) as $category) {
131 131
 						usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) {
132 132
 							$a_text = strtolower("{$a['title_data']['title']}");
133 133
 							$b_text = strtolower("{$b['title_data']['title']}");
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 					break;
143 143
 
144 144
 				case 'my_status':
145
-					foreach (array_keys($arr['series']) as $category) {
145
+					foreach(array_keys($arr['series']) as $category) {
146 146
 						usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) {
147 147
 							$a_text = strtolower("{$a['generated_current_data']['number']}");
148 148
 							$b_text = strtolower("{$b['generated_current_data']['number']}");
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 					break;
158 158
 
159 159
 				case 'latest':
160
-					foreach (array_keys($arr['series']) as $category) {
160
+					foreach(array_keys($arr['series']) as $category) {
161 161
 						usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) {
162 162
 							$a_text = new DateTime("{$a['title_data']['last_updated']}");
163 163
 							$b_text = new DateTime("{$b['title_data']['last_updated']}");
Please login to merge, or discard this patch.
application/controllers/User/Options.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -16,16 +16,16 @@  discard block
 block discarded – undo
16 16
 		$usedCategories   = $this->Tracker->category->getUsed($this->User->id);
17 17
 
18 18
 		//NOTE: The checkbox validation is handled in run()
19
-		$this->form_validation->set_rules('category_custom_1_text',  'Custom Category 1 Text',  'trim|regex_match[/^[a-zA-Z0-9-_\\s]{0,16}$/]');
20
-		$this->form_validation->set_rules('category_custom_2_text',  'Custom Category 2 Text',  'trim|regex_match[/^[a-zA-Z0-9-_\\s]{0,16}$/]');
21
-		$this->form_validation->set_rules('category_custom_3_text',  'Custom Category 3 Text',  'trim|regex_match[/^[a-zA-Z0-9-_\\s]{0,16}$/]');
19
+		$this->form_validation->set_rules('category_custom_1_text', 'Custom Category 1 Text', 'trim|regex_match[/^[a-zA-Z0-9-_\\s]{0,16}$/]');
20
+		$this->form_validation->set_rules('category_custom_2_text', 'Custom Category 2 Text', 'trim|regex_match[/^[a-zA-Z0-9-_\\s]{0,16}$/]');
21
+		$this->form_validation->set_rules('category_custom_3_text', 'Custom Category 3 Text', 'trim|regex_match[/^[a-zA-Z0-9-_\\s]{0,16}$/]');
22 22
 		$this->form_validation->set_rules('default_series_category', 'Default Series Category', 'required|is_valid_option_value[default_series_category]');
23
-		$this->form_validation->set_rules('list_sort_type',          'List Sort Type',          'required|is_valid_option_value[list_sort_type]');
24
-		$this->form_validation->set_rules('list_sort_order',         'List Sort Order',         'required|is_valid_option_value[list_sort_order]');
25
-		$this->form_validation->set_rules('theme',                   'Theme',                   'required|is_valid_option_value[theme]');
26
-		$this->form_validation->set_rules('mal_sync',                'MAL Sync',                'required|is_valid_option_value[mal_sync]');
23
+		$this->form_validation->set_rules('list_sort_type', 'List Sort Type', 'required|is_valid_option_value[list_sort_type]');
24
+		$this->form_validation->set_rules('list_sort_order', 'List Sort Order', 'required|is_valid_option_value[list_sort_order]');
25
+		$this->form_validation->set_rules('theme', 'Theme', 'required|is_valid_option_value[theme]');
26
+		$this->form_validation->set_rules('mal_sync', 'MAL Sync', 'required|is_valid_option_value[mal_sync]');
27 27
 
28
-		if ($isValid = $this->form_validation->run() === TRUE) {
28
+		if($isValid = $this->form_validation->run() === TRUE) {
29 29
 			foreach($customCategories as $categoryK => $category) {
30 30
 				if(!in_array($categoryK, $usedCategories)) {
31 31
 					$this->User_Options->set($category, $this->input->post($category) ? 'enabled' : 'disabled');
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
 			$this->User_Options->set('enable_live_countdown_timer', $this->input->post('enable_live_countdown_timer'));
40 40
 
41
-			$this->User_Options->set('list_sort_type',  $this->input->post('list_sort_type'));
41
+			$this->User_Options->set('list_sort_type', $this->input->post('list_sort_type'));
42 42
 			$this->User_Options->set('list_sort_order', $this->input->post('list_sort_order'));
43 43
 			
44 44
 			$this->User_Options->set('theme', $this->input->post('theme'));
Please login to merge, or discard this patch.
application/controllers/AdminPanel.php 2 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 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 AdminPanel extends Admin_Controller {
4 4
 	public function __construct() {
Please login to merge, or discard this 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/UpdateStatus.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 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 UpdateStatus extends MY_Controller {
4 4
 	public function __construct() {
Please login to merge, or discard this patch.
application/controllers/Ajax/TrackerInline.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 	 * URL:        /ajax/update_inline
27 27
 	 */
28 28
 	public function update() : void {
29
-		$this->form_validation->set_rules('id',      'Chapter ID', 'required|ctype_digit');
30
-		$this->form_validation->set_rules('chapter', 'Chapter',    'required');
29
+		$this->form_validation->set_rules('id', 'Chapter ID', 'required|ctype_digit');
30
+		$this->form_validation->set_rules('chapter', 'Chapter', 'required');
31 31
 
32 32
 		if($this->form_validation->run() === TRUE) {
33 33
 			$success = $this->Tracker->list->updateByID($this->userID, $this->input->post('id'), $this->input->post('chapter'));
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 	 * URL:        /tag_update
123 123
 	 */
124 124
 	public function tag_update() : void {
125
-		$this->form_validation->set_rules('id',         'Chapter ID', 'required|ctype_digit');
125
+		$this->form_validation->set_rules('id', 'Chapter ID', 'required|ctype_digit');
126 126
 		$this->form_validation->set_rules('tag_string', 'Tag String', 'max_length[255]|is_valid_tag_string|not_equals[none]');
127 127
 
128 128
 		if($this->form_validation->run() === TRUE) {
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 	 * URL:        /set_category
170 170
 	 */
171 171
 	public function set_category() : void {
172
-		$this->form_validation->set_rules('id[]',     'List of IDs',   'required|ctype_digit');
172
+		$this->form_validation->set_rules('id[]', 'List of IDs', 'required|ctype_digit');
173 173
 		$this->form_validation->set_rules('category', 'Category Name', 'required|is_valid_category');
174 174
 
175 175
 		if($this->form_validation->run() === TRUE) {
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
 	 * URL:        /ajax/ignore_inline
216 216
 	 */
217 217
 	public function ignore() : void {
218
-		$this->form_validation->set_rules('id',      'Chapter ID', 'required|ctype_digit');
219
-		$this->form_validation->set_rules('chapter', 'Chapter',    'required');
218
+		$this->form_validation->set_rules('id', 'Chapter ID', 'required|ctype_digit');
219
+		$this->form_validation->set_rules('chapter', 'Chapter', 'required');
220 220
 
221 221
 		if($this->form_validation->run() === TRUE) {
222 222
 			$success = $this->Tracker->list->ignoreByID($this->userID, $this->input->post('id'), $this->input->post('chapter'));
@@ -238,8 +238,8 @@  discard block
 block discarded – undo
238 238
 	 * URL:        /set_mal_id
239 239
 	 */
240 240
 	public function set_mal_id() : void {
241
-		$this->form_validation->set_rules('id',     'Chapter ID', 'required|ctype_digit');
242
-		$this->form_validation->set_rules('mal_id', 'MAL ID',     'regex_match[/^[0-9]*$/]');
241
+		$this->form_validation->set_rules('id', 'Chapter ID', 'required|ctype_digit');
242
+		$this->form_validation->set_rules('mal_id', 'MAL ID', 'regex_match[/^[0-9]*$/]');
243 243
 
244 244
 		if($this->form_validation->run() === TRUE) {
245 245
 			$malID = (is_numeric($this->input->post('mal_id')) ? $this->input->post('mal_id') : NULL);
Please login to merge, or discard this patch.
application/controllers/User/History.php 2 patches
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,9 @@  discard block
 block discarded – undo
6 6
 	}
7 7
 
8 8
 	public function index(int $page = 1) : void {
9
-		if($page === 0) redirect('user/history/1');
9
+		if($page === 0) {
10
+			redirect('user/history/1');
11
+		}
10 12
 
11 13
 		$this->header_data['title'] = "History";
12 14
 		$this->header_data['page']  = "history";
@@ -16,7 +18,9 @@  discard block
 block discarded – undo
16 18
 		$this->body_data['currentPage'] = (int) $page;
17 19
 		$this->body_data['totalPages']  = $historyData['totalPages'];
18 20
 
19
-		if($page > $this->body_data['totalPages'] && $page > 1) redirect('user/history/1');
21
+		if($page > $this->body_data['totalPages'] && $page > 1) {
22
+			redirect('user/history/1');
23
+		}
20 24
 
21 25
 		$this->_render_page('User/History');
22 26
 	}
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
 
32 32
 			case 'csv':
33 33
 				$this->output->set_content_type('text/csv', 'utf-8');
34
-				$this->_render_content($this->Tracker->portation->arrayToCSVRecursive($historyData, 'Date/Time,Title,URL,Site,Status', ',', '"', FALSE, TRUE), 'csv',TRUE, 'tracker-history');
34
+				$this->_render_content($this->Tracker->portation->arrayToCSVRecursive($historyData, 'Date/Time,Title,URL,Site,Status', ',', '"', FALSE, TRUE), 'csv', TRUE, 'tracker-history');
35 35
 				break;
36 36
 
37 37
 			default:
Please login to merge, or discard this patch.