Completed
Pull Request — master (#186)
by
unknown
02:31
created
application/models/Tracker/Sites/KireiCake.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 KireiCake extends Base_FoolSlide_Site_Model {
4 4
 	public $baseURL = 'https://reader.kireicake.com';
Please login to merge, or discard this patch.
application/models/Tracker/Sites/SeaOtterScans.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 SeaOtterScans extends Base_FoolSlide_Site_Model {
4 4
 	public $baseURL = 'https://reader.seaotterscans.com';
Please login to merge, or discard this patch.
application/models/Tracker/Sites/S2Scans.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 S2Scans extends Base_FoolSlide_Site_Model {
4 4
 	public $baseURL = 'https://reader.s2smanga.com';
Please login to merge, or discard this patch.
application/models/Tracker/Sites/WhiteoutScans.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 WhiteoutScans extends Base_FoolSlide_Site_Model {
4 4
 	public $baseURL = 'https://reader.whiteoutscans.com';
Please login to merge, or discard this patch.
application/models/Tracker/Sites/DokiFansubs.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 DokiFansubs extends Base_FoolSlide_Site_Model {
4 4
 	public $baseURL = 'https://kobato.hologfx.com/reader';
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Sites_Model.php 1 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/JaiminisBox.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 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 JaiminisBox extends Base_FoolSlide_Site_Model {
4 4
 	public $baseURL = 'https://jaiminisbox.com/reader';
5 5
 
6 6
 	//NOTE: Jaimini's Box appears to have disabled API support for some reason. Fallback to using the old method.
7
-	public function getTitleData(string $title_url, bool $firstGet = FALSE) : ?array {
7
+	public function getTitleData(string $title_url, bool $firstGet = FALSE) : ? array {
8 8
 		$fullURL = $this->getFullTitleURL($title_url);
9 9
 		$titleData = [];
10 10
 		if($content = $this->get_content($fullURL, "", "", FALSE, TRUE, ['adult' => 'true'])) {
Please login to merge, or discard this patch.
application/controllers/User/Auth/Forgot_Password.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -16,12 +16,12 @@  discard block
 block discarded – undo
16 16
 		$this->header_data['page']  = "forgot_password";
17 17
 
18 18
 		//TODO (RESEARCH): Should we allow username here too?
19
-		$this->form_validation->set_rules('email', 'Email',  'required|valid_email', array(
19
+		$this->form_validation->set_rules('email', 'Email', 'required|valid_email', array(
20 20
 			'required'    => 'Please enter your email.',
21 21
 			'valid_email' => 'The email your entered is invalid.'
22 22
 		));
23 23
 
24
-		if ($this->form_validation->run() === TRUE) {
24
+		if($this->form_validation->run() === TRUE) {
25 25
 			//form is valid
26 26
 
27 27
 			$identity = $this->ion_auth->where('email', $this->input->post('email'))->users()->row();
@@ -71,21 +71,21 @@  discard block
 block discarded – undo
71 71
 		$this->header_data['page'] = "reset-password";
72 72
 
73 73
 		$user = $this->ion_auth->forgotten_password_check($code);
74
-		if ($user) {
74
+		if($user) {
75 75
 			//code is valid, show reset form or process reset
76 76
 			$min_password_length = $this->config->item('min_password_length', 'ion_auth');
77 77
 			$max_password_length = $this->config->item('max_password_length', 'ion_auth');
78
-			$this->form_validation->set_rules('new_password',         "Password",         'required|min_length['.$min_password_length.']|max_length['.$max_password_length.']');
78
+			$this->form_validation->set_rules('new_password', "Password", 'required|min_length['.$min_password_length.']|max_length['.$max_password_length.']');
79 79
 			$this->form_validation->set_rules('new_password_confirm', "Password Confirm", 'required|matches[new_password]');
80 80
 
81
-			if ($this->form_validation->run() === TRUE) {
81
+			if($this->form_validation->run() === TRUE) {
82 82
 				//form is valid, process the password reset request
83 83
 				//TODO (Research): The original ion_auth auth.php sent the userid to the form, then matched it on return, is there any point to this?
84 84
 
85 85
 				$identity = $user->{'email'};
86 86
 				$change   = $this->ion_auth->reset_password($identity, $this->input->post('new_password'));
87 87
 
88
-				if ($change) {
88
+				if($change) {
89 89
 					//password changed successfully, redirect to login
90 90
 					$this->session->set_flashdata('notices', $this->ion_auth->messages());
91 91
 					redirect("user/login", 'refresh');
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Admin_Model.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 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'])) {
@@ -105,10 +105,10 @@  discard block
 block discarded – undo
105 105
 		                  ->get();
106 106
 
107 107
 		$sites = $query->result_array();
108
-		foreach ($sites as $site) {
108
+		foreach($sites as $site) {
109 109
 			$siteClass = $this->sites->{$site['site_class']};
110 110
 			if($titleDataList = $siteClass->doCustomUpdate()) {
111
-				foreach ($titleDataList as $titleURL => $titleData) {
111
+				foreach($titleDataList as $titleURL => $titleData) {
112 112
 					print "> {$titleData['title']} <{$site['site_class']}>"; //Print this prior to doing anything so we can more easily find out if something went wrong
113 113
 					if(is_array($titleData) && !is_null($titleData['latest_chapter'])) {
114 114
 						if($dbTitleData = $this->Tracker->title->getID($titleURL, (int) $site['id'], FALSE, TRUE)) {
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 		$query = $this->db->select('tracker_titles.id, tracker_titles.title_url, tracker_sites.site_class')
149 149
 		                  ->from('tracker_titles')
150 150
 		                  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
151
-		                  ->where('tracker_titles.followed','N')
151
+		                  ->where('tracker_titles.followed', 'N')
152 152
 		                  ->where('tracker_titles !=', '255')
153 153
 		                  ->where('tracker_sites.status', 'enabled')
154 154
 		                  ->where('tracker_sites.use_custom', 'Y')
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 		// @formatter:on
207 207
 
208 208
 		if($query->num_rows() > 0) {
209
-			foreach ($query->result() as $row) {
209
+			foreach($query->result() as $row) {
210 210
 				print "> {$row->title} <{$row->site_class}>"; //Print this prior to doing anything so we can more easily find out if something went wrong
211 211
 				$titleData = $this->sites->{$row->site_class}->getTitleData($row->title_url);
212 212
 				if($titleData['title'] && is_array($titleData) && !is_null($titleData['latest_chapter'])) {
Please login to merge, or discard this patch.