Completed
Push — master ( 5b9c46...18bcac )
by Angus
09:17
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.
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -71,32 +71,32 @@
 block discarded – undo
71 71
 
72 72
 			////We need the series to be tracked
73 73
 			$idCQuery = $this->db->select('id')
74
-			                     ->where('user_id', $userID)
75
-			                     ->where('title_id', $titleID)
76
-			                     ->get('tracker_chapters');
74
+								 ->where('user_id', $userID)
75
+								 ->where('title_id', $titleID)
76
+								 ->get('tracker_chapters');
77 77
 			if(!($idCQuery->num_rows() > 0)) {
78 78
 				//NOTE: This pretty much repeats a lot of what we already did above. Is there a better way to do this?
79 79
 				$this->Tracker->list->update($userID, $site, $title, $chapter, FALSE);
80 80
 
81 81
 				$idCQuery = $this->db->select('id')
82
-				                     ->where('user_id', $userID)
83
-				                     ->where('title_id', $titleID)
84
-				                     ->get('tracker_chapters');
82
+									 ->where('user_id', $userID)
83
+									 ->where('title_id', $titleID)
84
+									 ->get('tracker_chapters');
85 85
 			}
86 86
 			if($idCQuery->num_rows() > 0) {
87 87
 				$idCQueryRow = $idCQuery->row();
88 88
 
89 89
 				//Check if it is already favourited
90 90
 				$idFQuery = $this->db->select('id')
91
-				                     ->where('chapter_id', $idCQueryRow->id)
92
-				                     ->where('chapter', $chapter)
93
-				                     ->get('tracker_favourites');
91
+									 ->where('chapter_id', $idCQueryRow->id)
92
+									 ->where('chapter', $chapter)
93
+									 ->get('tracker_favourites');
94 94
 				if($idFQuery->num_rows() > 0) {
95 95
 					//Chapter is already favourited, so remove it from DB
96 96
 					$idFQueryRow = $idFQuery->row();
97 97
 
98 98
 					$isSuccess = (bool) $this->db->where('id', $idFQueryRow->id)
99
-					                             ->delete('tracker_favourites');
99
+												 ->delete('tracker_favourites');
100 100
 
101 101
 					if($isSuccess) {
102 102
 						$success = array(
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@  discard block
 block discarded – undo
14 14
 			          tf.chapter, 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)))
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
 			          tf.chapter, tf.updated_at', FALSE)
51 51
 			->from('tracker_favourites AS tf')
52 52
 			->join('tracker_chapters AS tc', 'tf.chapter_id = tc.id', 'left')
53
-			->join('tracker_titles AS tt',   'tc.title_id = tt.id',   'left')
54
-			->join('tracker_sites AS ts',    'tt.site_id = ts.id',    'left')
53
+			->join('tracker_titles AS tt', 'tc.title_id = tt.id', 'left')
54
+			->join('tracker_sites AS ts', 'tt.site_id = ts.id', 'left')
55 55
 			->where('tc.user_id', $this->User->id) //CHECK: Is this inefficient? Would it be better to have a user_id column in tracker_favourites?
56 56
 			->order_by('tf.id DESC')
57 57
 			->get();
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.