Completed
Push — master ( b308f6...b8c609 )
by Angus
02:56
created
application/models/Tracker/Tracker_Admin_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_Admin_Model extends Tracker_Base_Model {
4 4
 	public function __construct() {
Please login to merge, or discard this patch.
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
 						//Make sure last_checked is always updated on successful run.
75 75
 						//CHECK: Is there a reason we aren't just doing this in updateByID?
76 76
 						$this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE)
77
-						         ->where('id', $row->title_id)
78
-						         ->update('tracker_titles');
77
+								 ->where('id', $row->title_id)
78
+								 ->update('tracker_titles');
79 79
 
80 80
 						print " - ({$titleData['latest_chapter']})\n";
81 81
 					} else {
@@ -152,8 +152,8 @@  discard block
 block discarded – undo
152 152
 						//Make sure last_checked is always updated on successful run.
153 153
 						//CHECK: Is there a reason we aren't just doing this in updateByID?
154 154
 						$this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE)
155
-						         ->where('id', $row->title_id)
156
-						         ->update('tracker_titles');
155
+								 ->where('id', $row->title_id)
156
+								 ->update('tracker_titles');
157 157
 
158 158
 						print " - ({$titleData['latest_chapter']})\n";
159 159
 					} else {
@@ -177,10 +177,10 @@  discard block
 block discarded – undo
177 177
 	 */
178 178
 	public function updateCustom() {
179 179
 		$query = $this->db->select('*')
180
-		                  ->from('tracker_sites')
181
-		                  ->where('status', 'enabled')
182
-		                  ->where('tracker_sites.use_custom', 'Y')
183
-		                  ->get();
180
+						  ->from('tracker_sites')
181
+						  ->where('status', 'enabled')
182
+						  ->where('tracker_sites.use_custom', 'Y')
183
+						  ->get();
184 184
 
185 185
 		$sites = $query->result_array();
186 186
 		foreach ($sites as $site) {
@@ -196,8 +196,8 @@  discard block
 block discarded – undo
196 196
 									//Make sure last_checked is always updated on successful run.
197 197
 									//CHECK: Is there a reason we aren't just doing this in updateByID?
198 198
 									$this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE)
199
-									         ->where('id', $titleID)
200
-									         ->update('tracker_titles');
199
+											 ->where('id', $titleID)
200
+											 ->update('tracker_titles');
201 201
 
202 202
 									print " - ({$titleData['latest_chapter']})\n";
203 203
 								} else {
@@ -224,13 +224,13 @@  discard block
 block discarded – undo
224 224
 
225 225
 	public function refollowCustom() {
226 226
 		$query = $this->db->select('tracker_titles.id, tracker_titles.title_url, tracker_sites.site_class')
227
-		                  ->from('tracker_titles')
228
-		                  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
229
-		                  ->where('tracker_titles.followed','N')
230
-		                  ->where('tracker_titles !=', '255')
231
-		                  ->where('tracker_sites.status', 'enabled')
232
-		                  ->where('tracker_sites.use_custom', 'Y')
233
-		                  ->get();
227
+						  ->from('tracker_titles')
228
+						  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
229
+						  ->where('tracker_titles.followed','N')
230
+						  ->where('tracker_titles !=', '255')
231
+						  ->where('tracker_sites.status', 'enabled')
232
+						  ->where('tracker_sites.use_custom', 'Y')
233
+						  ->get();
234 234
 
235 235
 		if($query->num_rows() > 0) {
236 236
 			foreach($query->result() as $row) {
@@ -241,8 +241,8 @@  discard block
 block discarded – undo
241 241
 
242 242
 					if(!empty($titleData)) {
243 243
 						$this->db->set($titleData)
244
-						         ->where('id', $row->id)
245
-						         ->update('tracker_titles');
244
+								 ->where('id', $row->id)
245
+								 ->update('tracker_titles');
246 246
 
247 247
 						print "> {$row->site_class}:{$row->id}:{$row->title_url} FOLLOWED\n";
248 248
 					} else {
@@ -290,8 +290,8 @@  discard block
 block discarded – undo
290 290
 				if($titleData['title'] && is_array($titleData) && !is_null($titleData['latest_chapter'])) {
291 291
 					if($titleData['title'] !== $row->title) {
292 292
 						$this->db->set('title', $titleData['title'])
293
-						         ->where('id', $row->id)
294
-						         ->update('tracker_titles');
293
+								 ->where('id', $row->id)
294
+								 ->update('tracker_titles');
295 295
 						//TODO: Add to history somehow?
296 296
 						print " - NEW TITLE ({$titleData['title']})\n";
297 297
 					} else {
@@ -301,8 +301,8 @@  discard block
 block discarded – undo
301 301
 					//We might as well try to update as well.
302 302
 					if($this->Tracker->title->updateByID((int) $row->id, $titleData['latest_chapter'])) {
303 303
 						$this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE)
304
-						         ->where('id', $row->id)
305
-						         ->update('tracker_titles');
304
+								 ->where('id', $row->id)
305
+								 ->update('tracker_titles');
306 306
 					}
307 307
 				} else {
308 308
 					log_message('error', "{$row->title} failed to update title successfully");
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 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_Admin_Model extends Tracker_Base_Model {
4 4
 	public function __construct() {
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 		// @formatter:on
65 65
 
66 66
 		if($query->num_rows() > 0) {
67
-			foreach ($query->result() as $row) {
67
+			foreach($query->result() as $row) {
68 68
 				print "> {$row->title} <{$row->site_class}> | <{$row->title_id}>"; //Print this prior to doing anything so we can more easily find out if something went wrong
69 69
 				$titleData = $this->sites->{$row->site_class}->getTitleData($row->title_url);
70 70
 				if(is_array($titleData) && !is_null($titleData['latest_chapter'])) {
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 		$query = $query->get();
143 143
 
144 144
 		if($query->num_rows() > 0) {
145
-			foreach ($query->result() as $row) {
145
+			foreach($query->result() as $row) {
146 146
 				print "> {$row->title} <{$row->site_class}> | <{$row->title_id}>"; //Print this prior to doing anything so we can more easily find out if something went wrong
147 147
 				$titleData = $this->sites->{$row->site_class}->getTitleData($row->title_url);
148 148
 				if(is_array($titleData) && !is_null($titleData['latest_chapter'])) {
@@ -183,10 +183,10 @@  discard block
 block discarded – undo
183 183
 		                  ->get();
184 184
 
185 185
 		$sites = $query->result_array();
186
-		foreach ($sites as $site) {
186
+		foreach($sites as $site) {
187 187
 			$siteClass = $this->sites->{$site['site_class']};
188 188
 			if($titleDataList = $siteClass->doCustomUpdate()) {
189
-				foreach ($titleDataList as $titleURL => $titleData) {
189
+				foreach($titleDataList as $titleURL => $titleData) {
190 190
 					print "> {$titleData['title']} <{$site['site_class']}>"; //Print this prior to doing anything so we can more easily find out if something went wrong
191 191
 					if(is_array($titleData) && !is_null($titleData['latest_chapter'])) {
192 192
 						if($dbTitleData = $this->Tracker->title->getID($titleURL, (int) $site['id'], FALSE, TRUE)) {
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 		$query = $this->db->select('tracker_titles.id, tracker_titles.title_url, tracker_sites.site_class')
227 227
 		                  ->from('tracker_titles')
228 228
 		                  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
229
-		                  ->where('tracker_titles.followed','N')
229
+		                  ->where('tracker_titles.followed', 'N')
230 230
 		                  ->where('tracker_titles !=', '255')
231 231
 		                  ->where('tracker_sites.status', 'enabled')
232 232
 		                  ->where('tracker_sites.use_custom', 'Y')
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 		// @formatter:on
285 285
 
286 286
 		if($query->num_rows() > 0) {
287
-			foreach ($query->result() as $row) {
287
+			foreach($query->result() as $row) {
288 288
 				print "> {$row->title} <{$row->site_class}>"; //Print this prior to doing anything so we can more easily find out if something went wrong
289 289
 				$titleData = $this->sites->{$row->site_class}->getTitleData($row->title_url);
290 290
 				if($titleData['title'] && is_array($titleData) && !is_null($titleData['latest_chapter'])) {
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.
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -171,14 +171,14 @@  discard block
 block discarded – undo
171 171
 			}
172 172
 
173 173
 			$idQuery = $this->db->select('id')
174
-			                    ->where('user_id', $userID)
175
-			                    ->where('title_id', $titleID)
176
-			                    ->get('tracker_chapters');
174
+								->where('user_id', $userID)
175
+								->where('title_id', $titleID)
176
+								->get('tracker_chapters');
177 177
 			if($idQuery->num_rows() > 0) {
178 178
 				$success = (bool) $this->db->set(['current_chapter' => $chapter, 'active' => 'Y', 'last_updated' => NULL, 'ignore_chapter' => NULL])
179
-				                           ->where('user_id', $userID)
180
-				                           ->where('title_id', $titleID)
181
-				                           ->update('tracker_chapters');
179
+										   ->where('user_id', $userID)
180
+										   ->where('title_id', $titleID)
181
+										   ->update('tracker_chapters');
182 182
 
183 183
 				if($success) {
184 184
 					$idQueryRow = $idQuery->row();
@@ -204,9 +204,9 @@  discard block
 block discarded – undo
204 204
 	}
205 205
 	public function updateByID(int $userID, int $chapterID, string $chapter) : bool {
206 206
 		$success = (bool) $this->db->set(['current_chapter' => $chapter, 'active' => 'Y', 'last_updated' => NULL])
207
-		                           ->where('user_id', $userID)
208
-		                           ->where('id', $chapterID)
209
-		                           ->update('tracker_chapters');
207
+								   ->where('user_id', $userID)
208
+								   ->where('id', $chapterID)
209
+								   ->update('tracker_chapters');
210 210
 
211 211
 		if($success) {
212 212
 			$this->History->userUpdateTitle($chapterID, $chapter);
@@ -216,9 +216,9 @@  discard block
 block discarded – undo
216 216
 
217 217
 	public function ignoreByID(int $userID, int $chapterID, string $chapter) : bool {
218 218
 		$success = (bool) $this->db->set(['ignore_chapter' => $chapter, 'active' => 'Y', 'last_updated' => NULL])
219
-		                           ->where('user_id', $userID)
220
-		                           ->where('id', $chapterID)
221
-		                           ->update('tracker_chapters');
219
+								   ->where('user_id', $userID)
220
+								   ->where('id', $chapterID)
221
+								   ->update('tracker_chapters');
222 222
 
223 223
 		if($success) {
224 224
 			$this->History->userIgnoreTitle($chapterID, $chapter);
@@ -231,9 +231,9 @@  discard block
 block discarded – undo
231 231
 		//This is to allow user history to function properly.
232 232
 
233 233
 		$success = $this->db->set(['active' => 'N', 'last_updated' => NULL])
234
-		                    ->where('user_id', $userID)
235
-		                    ->where('id', $chapterID)
236
-		                    ->update('tracker_chapters');
234
+							->where('user_id', $userID)
235
+							->where('id', $chapterID)
236
+							->update('tracker_chapters');
237 237
 
238 238
 		return (bool) $success;
239 239
 	}
@@ -263,9 +263,9 @@  discard block
 block discarded – undo
263 263
 		//TODO: OPTION, USE BACKEND MAL ID DB WHERE POSSIBLE (DEFAULT TRUE)
264 264
 
265 265
 		$queryC = $this->db->select('mal_id')
266
-		                   ->where('user_id', $userID)
267
-		                   ->where('title_id', $titleID)
268
-		                   ->get('tracker_chapters');
266
+						   ->where('user_id', $userID)
267
+						   ->where('title_id', $titleID)
268
+						   ->get('tracker_chapters');
269 269
 
270 270
 		if($queryC->num_rows() > 0 && ($rowC = $queryC->row())) {
271 271
 			$malIDArr = [
@@ -274,8 +274,8 @@  discard block
 block discarded – undo
274 274
 			];
275 275
 		} else {
276 276
 			$queryT = $this->db->select('mal_id')
277
-			                   ->where('title_id', $titleID)
278
-			                   ->get('tracker_titles');
277
+							   ->where('title_id', $titleID)
278
+							   ->get('tracker_titles');
279 279
 
280 280
 			if($queryT->num_rows() > 0 && ($rowT = $queryT->row())) {
281 281
 				$malIDArr = [
@@ -289,9 +289,9 @@  discard block
 block discarded – undo
289 289
 		//TODO: Remove after a few weeks!
290 290
 		if(is_null($malIDArr)) {
291 291
 			$queryC2 = $this->db->select('tags')
292
-			                  ->where('user_id', $userID)
293
-			                  ->where('title_id', $titleID)
294
-			                  ->get('tracker_chapters');
292
+							  ->where('user_id', $userID)
293
+							  ->where('title_id', $titleID)
294
+							  ->get('tracker_chapters');
295 295
 
296 296
 			if($queryC2->num_rows() > 0 && ($tag_string = $queryC2->row()->tags) && !is_null($tag_string)) {
297 297
 				$arr   = preg_grep('/^mal:([0-9]+|none)$/', explode(',', $tag_string));
@@ -309,9 +309,9 @@  discard block
 block discarded – undo
309 309
 	public function setMalID(int $userID, int $chapterID, ?int $malID) : bool {
310 310
 		//TODO: Handle NULL?
311 311
 		$success = (bool) $this->db->set(['mal_id' => $malID, 'active' => 'Y', 'last_updated' => NULL])
312
-		                           ->where('user_id', $userID)
313
-		                           ->where('id', $chapterID)
314
-		                           ->update('tracker_chapters');
312
+								   ->where('user_id', $userID)
313
+								   ->where('id', $chapterID)
314
+								   ->update('tracker_chapters');
315 315
 
316 316
 		if($success) {
317 317
 			//MAL id update was successful, update history
Please login to merge, or discard this patch.
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -72,8 +72,12 @@  discard block
 block discarded – undo
72 72
 
73 73
 				$arr['series'][$row->category]['manga'][] = $data;
74 74
 
75
-				if(!$arr['has_inactive']) $arr['has_inactive'] = !$data['title_data']['active'];
76
-				if($arr['has_inactive'])  $arr['inactive_titles'][$data['full_title_url']] = $data['title_data']['title'];
75
+				if(!$arr['has_inactive']) {
76
+					$arr['has_inactive'] = !$data['title_data']['active'];
77
+				}
78
+				if($arr['has_inactive']) {
79
+					$arr['inactive_titles'][$data['full_title_url']] = $data['title_data']['title'];
80
+				}
77 81
 			}
78 82
 
79 83
 			//FIXME: This is not good for speed, but we're kind of required to do this for UX purposes.
@@ -107,11 +111,15 @@  discard block
 block discarded – undo
107 111
 
108 112
 							if($sortOrder == 'asc') {
109 113
 								$unreadSort = ($a_text <=> $b_text);
110
-								if($unreadSort) return $unreadSort;
114
+								if($unreadSort) {
115
+									return $unreadSort;
116
+								}
111 117
 								return $a_text2 <=> $b_text2;
112 118
 							} else {
113 119
 								$unreadSort = ($a_text <=> $b_text);
114
-								if($unreadSort) return $unreadSort;
120
+								if($unreadSort) {
121
+									return $unreadSort;
122
+								}
115 123
 								return $b_text2 <=> $a_text2;
116 124
 							}
117 125
 						});
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 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_List_Model extends Tracker_Base_Model {
4 4
 	public function __construct() {
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 			];
30 30
 		}
31 31
 		if($query->num_rows() > 0) {
32
-			foreach ($query->result() as $row) {
32
+			foreach($query->result() as $row) {
33 33
 				$is_unread = intval(($row->latest_chapter == $row->ignore_chapter) || ($row->latest_chapter == $row->current_chapter) ? '1' : '0');
34 34
 				$arr['series'][$row->category]['unread_count'] = (($arr['series'][$row->category]['unread_count'] ?? 0) + !$is_unread);
35 35
 				$data = [
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
 			$sortOrder = $this->User_Options->get('list_sort_order', $userID);
85 85
 			switch($this->User_Options->get('list_sort_type', $userID)) {
86 86
 				case 'unread':
87
-					foreach (array_keys($arr['series']) as $category) {
88
-						usort($arr['series'][$category]['manga'], function ($a, $b) use($sortOrder) {
87
+					foreach(array_keys($arr['series']) as $category) {
88
+						usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) {
89 89
 							$a_text = strtolower("{$a['new_chapter_exists']} - {$a['title_data']['title']}");
90 90
 							$b_text = strtolower("{$b['new_chapter_exists']} - {$b['title_data']['title']}");
91 91
 
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
 					break;
100 100
 
101 101
 				case 'unread_latest':
102
-					foreach (array_keys($arr['series']) as $category) {
103
-						usort($arr['series'][$category]['manga'], function ($a, $b) use($sortOrder) {
102
+					foreach(array_keys($arr['series']) as $category) {
103
+						usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) {
104 104
 							$a_text = $a['new_chapter_exists'];
105 105
 							$b_text = $b['new_chapter_exists'];
106 106
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 					break;
122 122
 
123 123
 				case 'alphabetical':
124
-					foreach (array_keys($arr['series']) as $category) {
124
+					foreach(array_keys($arr['series']) as $category) {
125 125
 						usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) {
126 126
 							$a_text = strtolower("{$a['title_data']['title']}");
127 127
 							$b_text = strtolower("{$b['title_data']['title']}");
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 					break;
137 137
 
138 138
 				case 'my_status':
139
-					foreach (array_keys($arr['series']) as $category) {
139
+					foreach(array_keys($arr['series']) as $category) {
140 140
 						usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) {
141 141
 							$a_text = strtolower("{$a['generated_current_data']['number']}");
142 142
 							$b_text = strtolower("{$b['generated_current_data']['number']}");
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 					break;
152 152
 
153 153
 				case 'latest':
154
-					foreach (array_keys($arr['series']) as $category) {
154
+					foreach(array_keys($arr['series']) as $category) {
155 155
 						usort($arr['series'][$category]['manga'], function($a, $b) use($sortOrder) {
156 156
 							$a_text = new DateTime("{$a['title_data']['last_updated']}");
157 157
 							$b_text = new DateTime("{$b['title_data']['last_updated']}");
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 		return $status;
284 284
 	}
285 285
 
286
-	public function getMalID(int $userID, int $titleID) : ?array{
286
+	public function getMalID(int $userID, int $titleID) : ? array{
287 287
 		$malIDArr = NULL;
288 288
 
289 289
 		//NEW METHOD
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 			                  ->get('tracker_chapters');
322 322
 
323 323
 			if($queryC2->num_rows() > 0 && ($tag_string = $queryC2->row()->tags) && !is_null($tag_string)) {
324
-				$arr   = preg_grep('/^mal:([0-9]+|none)$/', explode(',', $tag_string));
324
+				$arr = preg_grep('/^mal:([0-9]+|none)$/', explode(',', $tag_string));
325 325
 				if(!empty($arr)) {
326 326
 					$malIDArr = [
327 327
 						'id'   => explode(':', $arr[0])[1],
Please login to merge, or discard this patch.
application/config/development/database.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 defined('BASEPATH') OR exit('No direct script access allowed');
1
+<?php defined('BASEPATH') or exit('No direct script access allowed');
2 2
 
3 3
 $active_group  = 'default';
4 4
 $query_builder = TRUE;
Please login to merge, or discard this patch.
application/config/constants.php 2 patches
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
 | always be used to set the mode correctly.
27 27
 |
28 28
 */
29
-defined('FILE_READ_MODE')  OR define('FILE_READ_MODE', 0644);
29
+defined('FILE_READ_MODE') OR define('FILE_READ_MODE', 0644);
30 30
 defined('FILE_WRITE_MODE') OR define('FILE_WRITE_MODE', 0666);
31
-defined('DIR_READ_MODE')   OR define('DIR_READ_MODE', 0755);
32
-defined('DIR_WRITE_MODE')  OR define('DIR_WRITE_MODE', 0755);
31
+defined('DIR_READ_MODE') OR define('DIR_READ_MODE', 0755);
32
+defined('DIR_WRITE_MODE') OR define('DIR_WRITE_MODE', 0755);
33 33
 
34 34
 /*
35 35
 |--------------------------------------------------------------------------
@@ -39,14 +39,14 @@  discard block
 block discarded – undo
39 39
 | These modes are used when working with fopen()/popen()
40 40
 |
41 41
 */
42
-defined('FOPEN_READ')                           OR define('FOPEN_READ', 'rb');
43
-defined('FOPEN_READ_WRITE')                     OR define('FOPEN_READ_WRITE', 'r+b');
44
-defined('FOPEN_WRITE_CREATE_DESTRUCTIVE')       OR define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
42
+defined('FOPEN_READ') OR define('FOPEN_READ', 'rb');
43
+defined('FOPEN_READ_WRITE') OR define('FOPEN_READ_WRITE', 'r+b');
44
+defined('FOPEN_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
45 45
 defined('FOPEN_READ_WRITE_CREATE_DESCTRUCTIVE') OR define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
46
-defined('FOPEN_WRITE_CREATE')                   OR define('FOPEN_WRITE_CREATE', 'ab');
47
-defined('FOPEN_READ_WRITE_CREATE')              OR define('FOPEN_READ_WRITE_CREATE', 'a+b');
48
-defined('FOPEN_WRITE_CREATE_STRICT')            OR define('FOPEN_WRITE_CREATE_STRICT', 'xb');
49
-defined('FOPEN_READ_WRITE_CREATE_STRICT')       OR define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
46
+defined('FOPEN_WRITE_CREATE') OR define('FOPEN_WRITE_CREATE', 'ab');
47
+defined('FOPEN_READ_WRITE_CREATE') OR define('FOPEN_READ_WRITE_CREATE', 'a+b');
48
+defined('FOPEN_WRITE_CREATE_STRICT') OR define('FOPEN_WRITE_CREATE_STRICT', 'xb');
49
+defined('FOPEN_READ_WRITE_CREATE_STRICT') OR define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
50 50
 
51 51
 /*
52 52
 |--------------------------------------------------------------------------
@@ -73,18 +73,18 @@  discard block
 block discarded – undo
73 73
 |       http://tldp.org/LDP/abs/html/exitcodes.html
74 74
 |
75 75
 */
76
-defined('EXIT_SUCCESS')        OR define('EXIT_SUCCESS', 0); // no errors
77
-defined('EXIT_ERROR')          OR define('EXIT_ERROR', 1); // generic error
78
-defined('EXIT_CONFIG')         OR define('EXIT_CONFIG', 3); // configuration error
79
-defined('EXIT_UNKNOWN_FILE')   OR define('EXIT_UNKNOWN_FILE', 4); // file not found
80
-defined('EXIT_UNKNOWN_CLASS')  OR define('EXIT_UNKNOWN_CLASS', 5); // unknown class
76
+defined('EXIT_SUCCESS') OR define('EXIT_SUCCESS', 0); // no errors
77
+defined('EXIT_ERROR') OR define('EXIT_ERROR', 1); // generic error
78
+defined('EXIT_CONFIG') OR define('EXIT_CONFIG', 3); // configuration error
79
+defined('EXIT_UNKNOWN_FILE') OR define('EXIT_UNKNOWN_FILE', 4); // file not found
80
+defined('EXIT_UNKNOWN_CLASS') OR define('EXIT_UNKNOWN_CLASS', 5); // unknown class
81 81
 defined('EXIT_UNKNOWN_METHOD') OR define('EXIT_UNKNOWN_METHOD', 6); // unknown class member
82
-defined('EXIT_USER_INPUT')     OR define('EXIT_USER_INPUT', 7); // invalid user input
83
-defined('EXIT_DATABASE')       OR define('EXIT_DATABASE', 8); // database error
84
-defined('EXIT__AUTO_MIN')      OR define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
85
-defined('EXIT__AUTO_MAX')      OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
82
+defined('EXIT_USER_INPUT') OR define('EXIT_USER_INPUT', 7); // invalid user input
83
+defined('EXIT_DATABASE') OR define('EXIT_DATABASE', 8); // database error
84
+defined('EXIT__AUTO_MIN') OR define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
85
+defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
86 86
 
87 87
 /***** TIMEAGO CONSTANTS *****/
88 88
 defined('TIMEAGO_MONTH') OR define('TIMEAGO_MONTH', strtotime('-1 month')); //1 month ago
89
-defined('TIMEAGO_WEEK')  OR define('TIMEAGO_WEEK', strtotime('-1 week')); //1 week ago
90
-defined('TIMEAGO_3DAY')  OR define('TIMEAGO_3DAY', strtotime('-3 day')); //3 days ago
89
+defined('TIMEAGO_WEEK') OR define('TIMEAGO_WEEK', strtotime('-1 week')); //1 week ago
90
+defined('TIMEAGO_3DAY') OR define('TIMEAGO_3DAY', strtotime('-3 day')); //3 days ago
Please login to merge, or discard this patch.
Upper-Lower-Casing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-defined('BASEPATH') OR exit('No direct script access allowed');
2
+defined('BASEPATH') or exit('No direct script access allowed');
3 3
 
4 4
 /*
5 5
 |--------------------------------------------------------------------------
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 | of this setting
12 12
 |
13 13
 */
14
-defined('SHOW_DEBUG_BACKTRACE') OR define('SHOW_DEBUG_BACKTRACE', TRUE);
14
+defined('SHOW_DEBUG_BACKTRACE') or define('SHOW_DEBUG_BACKTRACE', TRUE);
15 15
 
16 16
 /*
17 17
 |--------------------------------------------------------------------------
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
 | always be used to set the mode correctly.
27 27
 |
28 28
 */
29
-defined('FILE_READ_MODE')  OR define('FILE_READ_MODE', 0644);
30
-defined('FILE_WRITE_MODE') OR define('FILE_WRITE_MODE', 0666);
31
-defined('DIR_READ_MODE')   OR define('DIR_READ_MODE', 0755);
32
-defined('DIR_WRITE_MODE')  OR define('DIR_WRITE_MODE', 0755);
29
+defined('FILE_READ_MODE')  or define('FILE_READ_MODE', 0644);
30
+defined('FILE_WRITE_MODE') or define('FILE_WRITE_MODE', 0666);
31
+defined('DIR_READ_MODE')   or define('DIR_READ_MODE', 0755);
32
+defined('DIR_WRITE_MODE')  or define('DIR_WRITE_MODE', 0755);
33 33
 
34 34
 /*
35 35
 |--------------------------------------------------------------------------
@@ -39,14 +39,14 @@  discard block
 block discarded – undo
39 39
 | These modes are used when working with fopen()/popen()
40 40
 |
41 41
 */
42
-defined('FOPEN_READ')                           OR define('FOPEN_READ', 'rb');
43
-defined('FOPEN_READ_WRITE')                     OR define('FOPEN_READ_WRITE', 'r+b');
44
-defined('FOPEN_WRITE_CREATE_DESTRUCTIVE')       OR define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
45
-defined('FOPEN_READ_WRITE_CREATE_DESCTRUCTIVE') OR define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
46
-defined('FOPEN_WRITE_CREATE')                   OR define('FOPEN_WRITE_CREATE', 'ab');
47
-defined('FOPEN_READ_WRITE_CREATE')              OR define('FOPEN_READ_WRITE_CREATE', 'a+b');
48
-defined('FOPEN_WRITE_CREATE_STRICT')            OR define('FOPEN_WRITE_CREATE_STRICT', 'xb');
49
-defined('FOPEN_READ_WRITE_CREATE_STRICT')       OR define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
42
+defined('FOPEN_READ')                           or define('FOPEN_READ', 'rb');
43
+defined('FOPEN_READ_WRITE')                     or define('FOPEN_READ_WRITE', 'r+b');
44
+defined('FOPEN_WRITE_CREATE_DESTRUCTIVE')       or define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
45
+defined('FOPEN_READ_WRITE_CREATE_DESCTRUCTIVE') or define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
46
+defined('FOPEN_WRITE_CREATE')                   or define('FOPEN_WRITE_CREATE', 'ab');
47
+defined('FOPEN_READ_WRITE_CREATE')              or define('FOPEN_READ_WRITE_CREATE', 'a+b');
48
+defined('FOPEN_WRITE_CREATE_STRICT')            or define('FOPEN_WRITE_CREATE_STRICT', 'xb');
49
+defined('FOPEN_READ_WRITE_CREATE_STRICT')       or define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
50 50
 
51 51
 /*
52 52
 |--------------------------------------------------------------------------
@@ -73,18 +73,18 @@  discard block
 block discarded – undo
73 73
 |       http://tldp.org/LDP/abs/html/exitcodes.html
74 74
 |
75 75
 */
76
-defined('EXIT_SUCCESS')        OR define('EXIT_SUCCESS', 0); // no errors
77
-defined('EXIT_ERROR')          OR define('EXIT_ERROR', 1); // generic error
78
-defined('EXIT_CONFIG')         OR define('EXIT_CONFIG', 3); // configuration error
79
-defined('EXIT_UNKNOWN_FILE')   OR define('EXIT_UNKNOWN_FILE', 4); // file not found
80
-defined('EXIT_UNKNOWN_CLASS')  OR define('EXIT_UNKNOWN_CLASS', 5); // unknown class
81
-defined('EXIT_UNKNOWN_METHOD') OR define('EXIT_UNKNOWN_METHOD', 6); // unknown class member
82
-defined('EXIT_USER_INPUT')     OR define('EXIT_USER_INPUT', 7); // invalid user input
83
-defined('EXIT_DATABASE')       OR define('EXIT_DATABASE', 8); // database error
84
-defined('EXIT__AUTO_MIN')      OR define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
85
-defined('EXIT__AUTO_MAX')      OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
76
+defined('EXIT_SUCCESS')        or define('EXIT_SUCCESS', 0); // no errors
77
+defined('EXIT_ERROR')          or define('EXIT_ERROR', 1); // generic error
78
+defined('EXIT_CONFIG')         or define('EXIT_CONFIG', 3); // configuration error
79
+defined('EXIT_UNKNOWN_FILE')   or define('EXIT_UNKNOWN_FILE', 4); // file not found
80
+defined('EXIT_UNKNOWN_CLASS')  or define('EXIT_UNKNOWN_CLASS', 5); // unknown class
81
+defined('EXIT_UNKNOWN_METHOD') or define('EXIT_UNKNOWN_METHOD', 6); // unknown class member
82
+defined('EXIT_USER_INPUT')     or define('EXIT_USER_INPUT', 7); // invalid user input
83
+defined('EXIT_DATABASE')       or define('EXIT_DATABASE', 8); // database error
84
+defined('EXIT__AUTO_MIN')      or define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
85
+defined('EXIT__AUTO_MAX')      or define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
86 86
 
87 87
 /***** TIMEAGO CONSTANTS *****/
88
-defined('TIMEAGO_MONTH') OR define('TIMEAGO_MONTH', strtotime('-1 month')); //1 month ago
89
-defined('TIMEAGO_WEEK')  OR define('TIMEAGO_WEEK', strtotime('-1 week')); //1 week ago
90
-defined('TIMEAGO_3DAY')  OR define('TIMEAGO_3DAY', strtotime('-3 day')); //3 days ago
88
+defined('TIMEAGO_MONTH') or define('TIMEAGO_MONTH', strtotime('-1 month')); //1 month ago
89
+defined('TIMEAGO_WEEK')  or define('TIMEAGO_WEEK', strtotime('-1 week')); //1 week ago
90
+defined('TIMEAGO_3DAY')  or define('TIMEAGO_3DAY', strtotime('-3 day')); //3 days ago
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/models/Tracker/Tracker_Sites_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_Sites_Model extends CI_Model {
4 4
 	public function __construct() {
Please login to merge, or discard this patch.
Braces   +27 added lines, -9 removed lines patch added patch discarded remove patch
@@ -44,12 +44,16 @@  discard block
 block discarded – undo
44 44
 
45 45
 	final public function isValidTitleURL(string $title_url) : bool {
46 46
 		$success = (bool) preg_match($this->titleFormat, $title_url);
47
-		if(!$success) log_message('error', "Invalid Title URL ({$this->site}): {$title_url}");
47
+		if(!$success) {
48
+			log_message('error', "Invalid Title URL ({$this->site}): {$title_url}");
49
+		}
48 50
 		return $success;
49 51
 	}
50 52
 	final public function isValidChapter(string $chapter) : bool {
51 53
 		$success = (bool) preg_match($this->chapterFormat, $chapter);
52
-		if(!$success) log_message('error', "Invalid Chapter ({$this->site}): {$chapter}");
54
+		if(!$success) {
55
+			log_message('error', "Invalid Chapter ({$this->site}): {$chapter}");
56
+		}
53 57
 		return $success;
54 58
 	}
55 59
 
@@ -60,10 +64,16 @@  discard block
 block discarded – undo
60 64
 		//curl_setopt($ch, CURLOPT_VERBOSE, 1);
61 65
 		curl_setopt($ch, CURLOPT_HEADER, 1);
62 66
 
63
-		if($follow_redirect)        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
67
+		if($follow_redirect) {
68
+			curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
69
+		}
64 70
 
65
-		if(!empty($cookie_string))  curl_setopt($ch, CURLOPT_COOKIE, $cookie_string);
66
-		if(!empty($cookiejar_path)) curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar_path);
71
+		if(!empty($cookie_string)) {
72
+			curl_setopt($ch, CURLOPT_COOKIE, $cookie_string);
73
+		}
74
+		if(!empty($cookiejar_path)) {
75
+			curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar_path);
76
+		}
67 77
 
68 78
 		//Some sites check the useragent for stuff, use a pre-defined user-agent to avoid stuff.
69 79
 		curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2824.0 Safari/537.36');
@@ -234,8 +244,12 @@  discard block
 block discarded – undo
234 244
 		$status = FALSE;
235 245
 
236 246
 		//Make sure we have a volume element
237
-		if(count($oldChapterSegments) === 1) array_unshift($oldChapterSegments, 'v0');
238
-		if(count($newChapterSegments) === 1) array_unshift($newChapterSegments, 'v0');
247
+		if(count($oldChapterSegments) === 1) {
248
+			array_unshift($oldChapterSegments, 'v0');
249
+		}
250
+		if(count($newChapterSegments) === 1) {
251
+			array_unshift($newChapterSegments, 'v0');
252
+		}
239 253
 
240 254
 		$oldCount = count($oldChapterSegments);
241 255
 		$newCount = count($newChapterSegments);
@@ -248,8 +262,12 @@  discard block
 block discarded – undo
248 262
 				$newVolume = substr(array_shift($newChapterSegments), 1);
249 263
 
250 264
 				//Forcing volume to 0 as TBD might not be the latest (although it can be, but that is covered by other checks)
251
-				if(in_array($oldVolume, ['TBD', 'TBA', 'NA', 'LMT'])) $oldVolume = 0;
252
-				if(in_array($newVolume, ['TBD', 'TBA', 'NA', 'LMT'])) $newVolume = 0;
265
+				if(in_array($oldVolume, ['TBD', 'TBA', 'NA', 'LMT'])) {
266
+					$oldVolume = 0;
267
+				}
268
+				if(in_array($newVolume, ['TBD', 'TBA', 'NA', 'LMT'])) {
269
+					$newVolume = 0;
270
+				}
253 271
 
254 272
 				$oldVolume = floatval($oldVolume);
255 273
 				$newVolume = floatval($newVolume);
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 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_Sites_Model extends CI_Model {
4 4
 	public function __construct() {
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
 	abstract public function getChapterData(string $title_url, string $chapter) : array;
41 41
 
42
-	abstract public function getTitleData(string $title_url, bool $firstGet = FALSE) : ?array;
42
+	abstract public function getTitleData(string $title_url, bool $firstGet = FALSE) : ? array;
43 43
 
44 44
 	final public function isValidTitleURL(string $title_url) : bool {
45 45
 		$success = (bool) preg_match($this->titleFormat, $title_url);
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	final protected function get_content(string $url, string $cookie_string = "", string $cookiejar_path = "", bool $follow_redirect = FALSE, bool $isPost = FALSE, array $postFields = []) {
56 56
 		$ch = curl_init();
57 57
 		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
58
-		curl_setopt($ch, CURLOPT_ENCODING , "gzip");
58
+		curl_setopt($ch, CURLOPT_ENCODING, "gzip");
59 59
 		//curl_setopt($ch, CURLOPT_VERBOSE, 1);
60 60
 		curl_setopt($ch, CURLOPT_HEADER, 1);
61 61
 
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
 		curl_setopt($ch, CURLOPT_URL, $url);
74 74
 
75 75
 		if($isPost) {
76
-			curl_setopt($ch,CURLOPT_POST, count($postFields));
77
-			curl_setopt($ch,CURLOPT_POSTFIELDS, http_build_query($postFields));
76
+			curl_setopt($ch, CURLOPT_POST, count($postFields));
77
+			curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postFields));
78 78
 		}
79 79
 
80 80
 		$response = curl_exec($ch);
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
 				$dom = new DOMDocument();
132 132
 				libxml_use_internal_errors(TRUE);
133
-				$dom->loadHTML('<?xml encoding="utf-8" ?>' . $data);
133
+				$dom->loadHTML('<?xml encoding="utf-8" ?>'.$data);
134 134
 				libxml_use_internal_errors(FALSE);
135 135
 
136 136
 				$xpath = new DOMXPath($dom);
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 				$nodes_row   = $xpath->query($node_row_string);
139 139
 				if($nodes_title->length === 1 && $nodes_row->length === 1) {
140 140
 					$firstRow      = $nodes_row->item(0);
141
-					$nodes_latest  = $xpath->query($node_latest_string,  $firstRow);
141
+					$nodes_latest  = $xpath->query($node_latest_string, $firstRow);
142 142
 
143 143
 					if($node_chapter_string !== '') {
144 144
 						$nodes_chapter = $xpath->query($node_chapter_string, $firstRow);
@@ -266,11 +266,11 @@  discard block
 block discarded – undo
266 266
 		$chapter_parts = explode('/', $chapter); //returns #LANG#/#VOLUME#/#CHAPTER#/#CHAPTER_EXTRA#(/#PAGE#/)
267 267
 		return [
268 268
 			'url'    => "{$this->baseURL}/read/{$title_url}/{$chapter}/",
269
-			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
269
+			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '')."c{$chapter_parts[2]}".(isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
270 270
 		];
271 271
 	}
272 272
 
273
-	public function getTitleData(string $title_url, bool $firstGet = FALSE) : ?array {
273
+	public function getTitleData(string $title_url, bool $firstGet = FALSE) : ? array {
274 274
 		$titleData = [];
275 275
 
276 276
 		$jsonURL = "{$this->baseURL}/api/reader/comic/stub/{$title_url}/format/json";
Please login to merge, or discard this patch.
application/models/Tracker/Sites/GameOfScanlation.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 GameOfScanlation extends Base_Site_Model {
4 4
 	public $titleFormat   = '/^[a-z0-9\.-]+$/';
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 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 GameOfScanlation extends Base_Site_Model {
4 4
 	public $titleFormat   = '/^[a-z0-9\.-]+$/';
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 		         The bad thing is these are interchangeable, despite them showing the exact same listing page.
10 10
 		         Thankfully the title_url of manga which use /forums/ seem to be appended with ".%ID%" which means we can easily check them. */
11 11
 
12
-		if (strpos($title_url, '.') !== FALSE) {
12
+		if(strpos($title_url, '.') !== FALSE) {
13 13
 			$format = "https://gameofscanlation.moe/forums/{$title_url}/";
14 14
 		} else {
15 15
 			$format = "https://gameofscanlation.moe/projects/{$title_url}/";
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 		];
25 25
 	}
26 26
 
27
-	public function getTitleData(string $title_url, bool $firstGet = FALSE) : ?array {
27
+	public function getTitleData(string $title_url, bool $firstGet = FALSE) : ? array {
28 28
 		$titleData = [];
29 29
 
30 30
 		$fullURL = $this->getFullTitleURL($title_url);
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
 			$titleData['latest_chapter'] = preg_replace('/^projects\/.*?\/(.*?)\/$/', '$1', (string) $data['nodes_chapter']->getAttribute('href'));
46 46
 
47
-			$titleData['last_updated'] =  date("Y-m-d H:i:s",(int) $data['nodes_latest']->getAttribute('title'));
47
+			$titleData['last_updated'] = date("Y-m-d H:i:s", (int) $data['nodes_latest']->getAttribute('title'));
48 48
 		}
49 49
 
50 50
 		return (!empty($titleData) ? $titleData : NULL);
Please login to merge, or discard this patch.
application/models/Tracker/Sites/EGScans.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 EGScans extends Base_Site_Model {
4 4
 	public $titleFormat   = '/^[A-Za-z0-9\-_\!,]+$/';
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 EGScans extends Base_Site_Model {
4 4
 	public $titleFormat   = '/^[A-Za-z0-9\-_\!,]+$/';
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 		];
16 16
 	}
17 17
 
18
-	public function getTitleData(string $title_url, bool $firstGet = FALSE) : ?array {
18
+	public function getTitleData(string $title_url, bool $firstGet = FALSE) : ? array {
19 19
 		$titleData = [];
20 20
 
21 21
 		$fullURL = $this->getFullTitleURL($title_url);
Please login to merge, or discard this patch.
application/models/Tracker/Sites/MangaPanda.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 MangaPanda extends Base_Site_Model {
4 4
 	//NOTE: MangaPanda has manga pages under the root URL, so we need to filter out pages we know that aren't manga.
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 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 MangaPanda extends Base_Site_Model {
4 4
 	//NOTE: MangaPanda has manga pages under the root URL, so we need to filter out pages we know that aren't manga.
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 		];
17 17
 	}
18 18
 
19
-	public function getTitleData(string $title_url, bool $firstGet = FALSE) : ?array {
19
+	public function getTitleData(string $title_url, bool $firstGet = FALSE) : ? array {
20 20
 		$titleData = [];
21 21
 
22 22
 		$fullURL = $this->getFullTitleURL($title_url);
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
 			$titleData['latest_chapter'] = preg_replace('/^.*\/([0-9]+)$/', '$1', (string) $data['nodes_chapter']->getAttribute('href'));
37 37
 
38
-			$titleData['last_updated'] =  date("Y-m-d H:i:s", strtotime((string) $data['nodes_latest']->nodeValue));
38
+			$titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $data['nodes_latest']->nodeValue));
39 39
 		}
40 40
 
41 41
 		return (!empty($titleData) ? $titleData : NULL);
Please login to merge, or discard this patch.