Completed
Push — master ( 6e7085...17085c )
by Angus
04:44
created
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.
_scripts/generate_spritesheet.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);
1
+<?php declare(strict_types = 1);
2 2
 
3 3
 if(!extension_loaded('gd')) die('GD ext is required to run this!');
4 4
 
@@ -23,11 +23,11 @@  discard block
 block discarded – undo
23 23
 		imagealphablending($sheetImage, FALSE);
24 24
 		imagesavealpha($sheetImage, TRUE);
25 25
 
26
-		imagefill($sheetImage,0,0,0x7fff0000);
26
+		imagefill($sheetImage, 0, 0, 0x7fff0000);
27 27
 
28 28
 		$x = 0;
29
-		foreach ($this->fileList as $filename) {
30
-			$siteImage = imagecreatefrompng(ICON_FOLDER. "/{$filename}");
29
+		foreach($this->fileList as $filename) {
30
+			$siteImage = imagecreatefrompng(ICON_FOLDER."/{$filename}");
31 31
 			imagealphablending($siteImage, TRUE);
32 32
 
33 33
 			$dst_x = ((16 + 2) * $x);
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 		if(preg_match('/\.sprite-site.*\@cache-version: ([0-9]+);/s', $oldLESS, $cvMatches)) {
58 58
 			$cacheVersion = ((int) $cvMatches[1]) + 1;
59 59
 
60
-			$newLESS = preg_replace('/\.sprite-site.*/s', '',$oldLESS);
60
+			$newLESS = preg_replace('/\.sprite-site.*/s', '', $oldLESS);
61 61
 			$newLESS .= ''.
62 62
 				".sprite-site {\n".
63 63
 				"	.sprite();\n".
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/History_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 History_Model extends CI_Model {
4 4
 	public function __construct() {
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 			foreach($result as $row) {
50 50
 				$arrRow = [];
51 51
 
52
-				$arrRow['updated_at']  = $row->updated_at;
52
+				$arrRow['updated_at'] = $row->updated_at;
53 53
 
54 54
 				$newChapterData = $this->Tracker->sites->{$row->site_class}->getChapterData($row->title_url, $row->new_chapter);
55 55
 				$arrRow['new_chapter']      = "<a href=\"{$newChapterData['url']}\">{$newChapterData['number']}</a>";
Please login to merge, or discard this patch.
application/models/User_Options_Model.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 User_Options_Model extends CI_Model {
4 4
 	public $options = array(
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 			$query = $this->db->select('value_str, value_int')
201 201
 			                  ->from('user_options')
202 202
 			                  ->where('user_id', $userID)
203
-			                  ->where('name',    $option)
203
+			                  ->where('name', $option)
204 204
 			                  ->limit(1);
205 205
 			$data = $query->get()->row_array();
206 206
 		} else {
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 				$query = $this->db->select('value_str, value_int')
209 209
 				                  ->from('user_options')
210 210
 				                  ->where('user_id', $userID)
211
-				                  ->where('name',    $option)
211
+				                  ->where('name', $option)
212 212
 				                  ->limit(1);
213 213
 				$data = $query->get()->row_array();
214 214
 				$this->session->set_tempdata("option_{$option}", $data, 3600);
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 			);
262 262
 			//FIXME: Get a better solution than str_replace for removing special characters
263 263
 			$elements = array();
264
-			foreach (array_values($this->options[$option]['valid_options']) as $valid_option) {
264
+			foreach(array_values($this->options[$option]['valid_options']) as $valid_option) {
265 265
 				$elements[$option.'_'.str_replace(',', '_', $valid_option)] = array_merge($base_attributes, array(
266 266
 					'value' => $valid_option
267 267
 				));
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Base_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_Base_Model extends CI_Model {
4 4
 	public $sites;
@@ -26,7 +26,7 @@  discard block
 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/views/User/Dashboard.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@
 block discarded – undo
136 136
 						|
137 137
 						<a href="#" class="set-mal-id" data-mal-id="<?=$row['mal_id']?>" data-mal-type="<?=$row['mal_type']?>">Set MAL ID</a> <?php if(!is_null($row['mal_id']) && $row['mal_type'] == 'chapter') { ?><span>(<small><?=($row['mal_id'] !== '0' ? $row['mal_id'] : 'none')?></small>)</span><?php } ?>
138 138
 						|
139
-						Tags (<a href="#" class="edit-tags small">Edit</a>): <span class="text-lowercase tag-list"><?=($row['has_tags'] ? implode("", array_map(function ($str) { return "<i class='tag'>{$str}</i>"; }, explode(",", $row['tag_list']))) : "none")?></span>
139
+						Tags (<a href="#" class="edit-tags small">Edit</a>): <span class="text-lowercase tag-list"><?=($row['has_tags'] ? implode("", array_map(function($str) { return "<i class='tag'>{$str}</i>"; }, explode(",", $row['tag_list']))) : "none")?></span>
140 140
 						<div class="input-group hidden tag-edit">
141 141
 							<input type="text" class="form-control" placeholder="tag1,tag2,tag3" maxlength="255" pattern='[a-z0-9-_,]{0,255}' value="<?=$row['tag_list']?>">
142 142
 							<span class="input-group-btn">
Please login to merge, or discard this patch.