Completed
Push — master ( f2d2ea...222f63 )
by Angus
02:44
created
application/controllers/UpdateStatus.php 1 patch
Spacing   +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/AdminPanel.php 1 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 AdminPanel extends Admin_Controller {
4 4
 	public function __construct() {
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
 				if(!empty($matches)) {
82 82
 					$malID = ($matches[1] !== 'none' ? $matches[1] : '0');
83
-					$new_tags = implode(',', array_diff( explode(',', $row->tags), [$matches[0]]));
83
+					$new_tags = implode(',', array_diff(explode(',', $row->tags), [$matches[0]]));
84 84
 
85 85
 					$this->db->set(['mal_id' => $malID, 'tags' => $new_tags, 'last_updated' => NULL])
86 86
 					         ->where('id', $row->id)
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/Ajax/Userscript.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
 	public function report_bug() : void {
79 79
 		$this->load->library('user_agent');
80 80
 		if($this->output->is_custom_header_set()) { $this->output->reset_status_header(); return; }
81
-		$this->form_validation->set_rules('bug[url]',  'Bug [URL]',  'required');
81
+		$this->form_validation->set_rules('bug[url]', 'Bug [URL]', 'required');
82 82
 		$this->form_validation->set_rules('bug[text]', 'Bug [Text]', 'required');
83 83
 
84 84
 		if($this->form_validation->run() === TRUE) {
Please login to merge, or discard this patch.
application/helpers/generic_helper.php 1 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
 /**
4 4
  * Checks if view file exists.
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @return bool
7 7
  */
8 8
 function view_exists(string $path) : bool {
9
-	return file_exists(APPPATH . "/views/{$path}.php");
9
+	return file_exists(APPPATH."/views/{$path}.php");
10 10
 }
11 11
 
12 12
 function get_time_class(string $time_string) : string {
@@ -32,19 +32,19 @@  discard block
 block discarded – undo
32 32
 	return $time_string;
33 33
 }
34 34
 
35
-if (!function_exists('http_parse_headers')) { #http://www.php.net/manual/en/function.http-parse-headers.php#112917
36
-	function http_parse_headers (string $raw_headers) : array {
35
+if(!function_exists('http_parse_headers')) { #http://www.php.net/manual/en/function.http-parse-headers.php#112917
36
+	function http_parse_headers(string $raw_headers) : array {
37 37
 		$headers = array(); // $headers = [];
38
-		foreach (explode("\n", $raw_headers) as $i => $h) {
38
+		foreach(explode("\n", $raw_headers) as $i => $h) {
39 39
 			$h = explode(':', $h, 2);
40
-			if (isset($h[1])){
41
-				if(!isset($headers[$h[0]])){
40
+			if(isset($h[1])) {
41
+				if(!isset($headers[$h[0]])) {
42 42
 					$headers[$h[0]] = trim($h[1]);
43
-				}else if(is_array($headers[$h[0]])){
44
-					$tmp = array_merge($headers[$h[0]],array(trim($h[1])));
43
+				} else if(is_array($headers[$h[0]])) {
44
+					$tmp = array_merge($headers[$h[0]], array(trim($h[1])));
45 45
 					$headers[$h[0]] = $tmp;
46
-				}else{
47
-					$tmp = array_merge(array($headers[$h[0]]),array(trim($h[1])));
46
+				} else {
47
+					$tmp = array_merge(array($headers[$h[0]]), array(trim($h[1])));
48 48
 					$headers[$h[0]] = $tmp;
49 49
 				}
50 50
 			}
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Stats_Model.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed');
1
+<?php declare(strict_types = 1); defined('BASEPATH') OR exit('No direct script access allowed');
2 2
 
3 3
 class Tracker_Stats_Model extends Tracker_Base_Model {
4 4
 	public function __construct() {
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 				], FALSE)
29 29
 				->from('tracker_chapters')
30 30
 				->join('tracker_titles', 'tracker_titles.id = tracker_chapters.title_id', 'left')
31
-				->join('tracker_sites','tracker_titles.site_id = tracker_sites.id', 'left')
31
+				->join('tracker_sites', 'tracker_titles.site_id = tracker_sites.id', 'left')
32 32
 				->group_by('tracker_chapters.title_id')
33 33
 				->having('count > 1')
34 34
 				->order_by('count DESC')
Please login to merge, or discard this patch.
application/models/Tracker/Sites/DynastyScans.php 1 patch
Spacing   +6 added lines, -6 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 DynastyScans extends Base_Site_Model {
4 4
 	//FIXME: This has some major issues. SEE: https://github.com/DakuTree/manga-tracker/issues/58
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 		*/
24 24
 
25 25
 		$chapterData = [
26
-			'url'    => 'https://dynasty-scans.com/chapters/' . $title_parts[0].'_'.$chapter,
26
+			'url'    => 'https://dynasty-scans.com/chapters/'.$title_parts[0].'_'.$chapter,
27 27
 			'number' => ''
28 28
 		];
29 29
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 		return $chapterData;
52 52
 	}
53 53
 
54
-	public function getTitleData(string $title_url, bool $firstGet = FALSE) : ?array {
54
+	public function getTitleData(string $title_url, bool $firstGet = FALSE) : ? array {
55 55
 		$titleData = [];
56 56
 
57 57
 		$fullURL = $this->getFullTitleURL($title_url);
@@ -78,13 +78,13 @@  discard block
 block discarded – undo
78 78
 					}
79 79
 
80 80
 					$chapterURLSegments = explode('/', (string) $data['nodes_chapter']->getAttribute('href'));
81
-					if (strpos($chapterURLSegments[2], $title_parts[0]) !== false) {
81
+					if(strpos($chapterURLSegments[2], $title_parts[0]) !== false) {
82 82
 						$titleData['latest_chapter'] = substr($chapterURLSegments[2], strlen($title_parts[0]) + 1);
83 83
 					} else {
84 84
 						$titleData['latest_chapter'] = $chapterURLSegments[2];
85 85
 					}
86 86
 
87
-					$titleData['last_updated'] =  date("Y-m-d H:i:s", strtotime(str_replace("'", '', substr((string) $data['nodes_latest']->textContent, 9))));
87
+					$titleData['last_updated'] = date("Y-m-d H:i:s", strtotime(str_replace("'", '', substr((string) $data['nodes_latest']->textContent, 9))));
88 88
 				}
89 89
 				break;
90 90
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 
95 95
 				preg_match('/<b>.*<\/b>/', $data, $matchesT);
96 96
 				preg_match('/\/doujins\/[^"]+">(.+)?(?=<\/a>)<\/a>/', $data, $matchesD);
97
-				$titleData['title'] = (!empty($matchesD) ? ($matchesD[1] !== 'Original' ? $matchesD[1].' - ' : '') : '') . substr($matchesT[0], 3, -4);
97
+				$titleData['title'] = (!empty($matchesD) ? ($matchesD[1] !== 'Original' ? $matchesD[1].' - ' : '') : '').substr($matchesT[0], 3, -4);
98 98
 
99 99
 				$titleData['latest_chapter'] = 'oneshot'; //This will never change
100 100
 
Please login to merge, or discard this patch.
application/models/Tracker/Sites/MangaHere.php 1 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 MangaHere extends Base_Site_Model {
4 4
 	public $titleFormat   = '/^[a-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);
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
 
36 36
 			$link = preg_replace('/^(.*\/)(?:[0-9]+\.html)?$/', '$1', (string) $data['nodes_chapter']->getAttribute('href'));
37 37
 			$chapterURLSegments = explode('/', $link);
38
-			$titleData['latest_chapter'] = $chapterURLSegments[5] . (isset($chapterURLSegments[6]) && !empty($chapterURLSegments[6]) ? "/{$chapterURLSegments[6]}" : "");
39
-			$titleData['last_updated'] =  date("Y-m-d H:i:s", strtotime((string) $data['nodes_latest']->nodeValue));
38
+			$titleData['latest_chapter'] = $chapterURLSegments[5].(isset($chapterURLSegments[6]) && !empty($chapterURLSegments[6]) ? "/{$chapterURLSegments[6]}" : "");
39
+			$titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $data['nodes_latest']->nodeValue));
40 40
 		}
41 41
 
42 42
 		return (!empty($titleData) ? $titleData : NULL);
Please login to merge, or discard this patch.
application/models/Tracker/Sites/KissManga.php 1 patch
Spacing   +5 added lines, -5 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 KissManga extends Base_Site_Model {
4 4
 	/* This site is a massive pain in the ass. The only reason I'm supporting it is it's one of the few aggregator sites which actually support more risqué manga.
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 		];
31 31
 	}
32 32
 
33
-	public function getTitleData(string $title_url, bool $firstGet = FALSE) : ?array {
33
+	public function getTitleData(string $title_url, bool $firstGet = FALSE) : ? array {
34 34
 		$titleData = [];
35 35
 
36 36
 		//Check if cookiejar is a day old (so we can know if something went wrong)
@@ -59,13 +59,13 @@  discard block
 block discarded – undo
59 59
 					$titleData['title'] = $nodes_title->item(0)->textContent;
60 60
 
61 61
 					$firstRow      = $nodes_row->item(0);
62
-					$nodes_latest  = $xpath->query("td[2]",   $firstRow);
62
+					$nodes_latest  = $xpath->query("td[2]", $firstRow);
63 63
 					$nodes_chapter = $xpath->query("td[1]/a", $firstRow);
64 64
 
65 65
 					$link = (string) $nodes_chapter->item(0)->getAttribute('href');
66 66
 					$chapterURLSegments = explode('/', preg_replace('/\?.*$/', '', $link));
67
-					$titleData['latest_chapter'] = $chapterURLSegments[3] . ':--:' . preg_replace('/.*?([0-9]+)$/', '$1', $link);
68
-					$titleData['last_updated'] =  date("Y-m-d H:i:s", strtotime((string) $nodes_latest->item(0)->textContent));
67
+					$titleData['latest_chapter'] = $chapterURLSegments[3].':--:'.preg_replace('/.*?([0-9]+)$/', '$1', $link);
68
+					$titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $nodes_latest->item(0)->textContent));
69 69
 				}
70 70
 			} else {
71 71
 				//TODO: Throw ERRORS;
Please login to merge, or discard this patch.