Completed
Push — master ( 9ed743...6b5e3b )
by Angus
02:43
created
application/controllers/Stats.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
 class Stats extends MY_Controller {
4 4
 	public function __construct() {
Please login to merge, or discard this patch.
application/controllers/Import_AMR.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
 class Import_AMR extends User_Controller {
4 4
 	public function __construct() {
Please login to merge, or discard this patch.
application/controllers/TitleHistory.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 defined('BASEPATH') OR exit('No direct script access allowed');
1
+<?php defined('BASEPATH') or exit('No direct script access allowed');
2 2
 
3 3
 class TitleHistory extends Auth_Controller {
4 4
 	public function __construct() {
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,9 @@
 block discarded – undo
23 23
 			$this->body_data['totalPages']  = $historyData['totalPages'];
24 24
 			$this->body_data['titleID']     = (int) $titleID;
25 25
 
26
-			if($page > $this->body_data['totalPages'] && $page > 1) redirect("/history/{$titleID}/1");
26
+			if($page > $this->body_data['totalPages'] && $page > 1) {
27
+				redirect("/history/{$titleID}/1");
28
+			}
27 29
 
28 30
 			$this->_render_page("TitleHistory");
29 31
 
Please login to merge, or discard this patch.
application/models/Tracker_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
 include_once APPPATH.'models/Tracker/Tracker_Base_Model.php';
4 4
 foreach (glob(APPPATH.'models/Tracker/*.php') as $filename) {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed');
2 2
 
3 3
 include_once APPPATH.'models/Tracker/Tracker_Base_Model.php';
4
-foreach (glob(APPPATH.'models/Tracker/*.php') as $filename) {
4
+foreach(glob(APPPATH.'models/Tracker/*.php') as $filename) {
5 5
 	/** @noinspection PhpIncludeInspection */
6 6
 	include_once $filename;
7 7
 }
Please login to merge, or discard this patch.
application/models/History_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 History_Model extends CI_Model {
4 4
 	public function __construct() {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
 			foreach($result as $row) {
58 58
 				$arrRow = [];
59 59
 
60
-				$arrRow['updated_at']  = $row->updated_at;
60
+				$arrRow['updated_at'] = $row->updated_at;
61 61
 
62 62
 				$newChapterData = $this->Tracker->sites->{$row->site_class}->getChapterData($row->title_url, $row->new_chapter);
63 63
 				$arrRow['new_chapter']      = "<a href=\"{$newChapterData['url']}\">{$newChapterData['number']}</a>";
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Stats_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_Stats_Model extends Tracker_Base_Model {
4 4
 	public function __construct() {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 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
 				->where('tracker_sites.status', 'enabled')
33 33
 				->group_by('tracker_chapters.title_id')
34 34
 				->having('count > 1')
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Portation_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
 //http://english.stackexchange.com/a/141735
4 4
 class Tracker_Portation_Model extends Tracker_Base_Model {
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
 		$arr = [];
63 63
 		if($query->num_rows() > 0) {
64
-			foreach ($query->result() as $row) {
64
+			foreach($query->result() as $row) {
65 65
 				$arr[$row->category][] = [
66 66
 					'site'            => $row->site,
67 67
 					'title_url'       => $row->title_url,
@@ -94,15 +94,15 @@  discard block
 block discarded – undo
94 94
 		$enclosure_esc = preg_quote($enclosure, '/');
95 95
 
96 96
 		$output = array();
97
-		foreach ($fields as $field) {
98
-			if ($field === NULL && $nullToMysqlNull) {
97
+		foreach($fields as $field) {
98
+			if($field === NULL && $nullToMysqlNull) {
99 99
 				$output[] = 'NULL';
100 100
 				continue;
101 101
 			}
102 102
 
103 103
 			// Enclose fields containing $delimiter, $enclosure or whitespace
104
-			if ($encloseAll || preg_match("/(?:${delimiter_esc}|${enclosure_esc}|\s)/", $field)) {
105
-				$output[] = $enclosure . str_replace($enclosure, $enclosure . $enclosure, $field) . $enclosure;
104
+			if($encloseAll || preg_match("/(?:${delimiter_esc}|${enclosure_esc}|\s)/", $field)) {
105
+				$output[] = $enclosure.str_replace($enclosure, $enclosure.$enclosure, $field).$enclosure;
106 106
 			} else {
107 107
 				$output[] = $field;
108 108
 			}
@@ -116,10 +116,10 @@  discard block
 block discarded – undo
116 116
 			$csvArr[] = $headers;
117 117
 		}
118 118
 
119
-		foreach ($fields as $field) {
120
-			$csvArr[] = $this->arrayToCSV($field, $delimiter, $enclosure,$encloseAll,$nullToMysqlNull);
119
+		foreach($fields as $field) {
120
+			$csvArr[] = $this->arrayToCSV($field, $delimiter, $enclosure, $encloseAll, $nullToMysqlNull);
121 121
 		}
122 122
 
123
-		return implode(PHP_EOL,$csvArr);
123
+		return implode(PHP_EOL, $csvArr);
124 124
 	}
125 125
 }
Please login to merge, or discard this patch.
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.