Completed
Pull Request — master (#186)
by
unknown
02:31
created
application/tests_codeception/_support/AcceptanceTester.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,7 @@
 block discarded – undo
16 16
  *
17 17
  * @SuppressWarnings(PHPMD)
18 18
 */
19
-class AcceptanceTester extends \Codeception\Actor
20
-{
19
+class AcceptanceTester extends \Codeception\Actor {
21 20
     use _generated\AcceptanceTesterActions;
22 21
 
23 22
    /**
Please login to merge, or discard this patch.
application/tests_codeception/_support/FunctionalTester.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,7 @@
 block discarded – undo
16 16
  *
17 17
  * @SuppressWarnings(PHPMD)
18 18
 */
19
-class FunctionalTester extends \Codeception\Actor
20
-{
19
+class FunctionalTester extends \Codeception\Actor {
21 20
     use _generated\FunctionalTesterActions;
22 21
 
23 22
    /**
Please login to merge, or discard this patch.
application/libraries/MY_Form_validation.php 1 patch
Braces   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,8 +30,7 @@  discard block
 block discarded – undo
30 30
 	public function valid_password(string $password) : bool {
31 31
 		if(!($isValid = $this->min_length($password, $this->CI->config->item('min_password_length', 'ion_auth')))) {
32 32
 			$this->set_message('valid_password', 'The password is too short!');
33
-		}
34
-		elseif(!($isValid = $this->max_length($password, $this->CI->config->item('max_password_length', 'ion_auth')))) {
33
+		} elseif(!($isValid = $this->max_length($password, $this->CI->config->item('max_password_length', 'ion_auth')))) {
35 34
 			$this->set_message('valid_password', 'The password is too long!');
36 35
 		}
37 36
 		return $isValid;
@@ -91,7 +90,7 @@  discard block
 block discarded – undo
91 90
 	 */
92 91
 	public function isRuleValid(string $ruleName) : bool {
93 92
 		$isValid = FALSE;
94
-		if(is_string($ruleName) && $this->has_rule($ruleName)){
93
+		if(is_string($ruleName) && $this->has_rule($ruleName)) {
95 94
 			$isValid = !in_array($ruleName, array_keys($this->error_array()), TRUE);
96 95
 		}
97 96
 		return $isValid;
Please login to merge, or discard this patch.
application/models/User_Options_Model.php 1 patch
Braces   +10 added lines, -3 removed lines patch added patch discarded remove patch
@@ -137,7 +137,9 @@  discard block
 block discarded – undo
137 137
 				}
138 138
 
139 139
 				$success = $this->set_db($idData, $valueData);
140
-				if($success) $this->session->unset_tempdata("option_{$option}");
140
+				if($success) {
141
+					$this->session->unset_tempdata("option_{$option}");
142
+				}
141 143
 			} else {
142 144
 				$success = FALSE;
143 145
 			}
@@ -164,7 +166,9 @@  discard block
 block discarded – undo
164 166
 			}
165 167
 
166 168
 			//Overall fallback method.
167
-			if(!isset($value)) $value = $this->options[$option]['default'];
169
+			if(!isset($value)) {
170
+				$value = $this->options[$option]['default'];
171
+			}
168 172
 		} else {
169 173
 			$value = FALSE;
170 174
 		}
@@ -215,7 +219,10 @@  discard block
 block discarded – undo
215 219
 				//This should never happen.
216 220
 				break;
217 221
 		}
218
-		if(!isset($value)) $value = FALSE; //FIXME: This won't play nice with BOOL type false?
222
+		if(!isset($value)) {
223
+			$value = FALSE;
224
+		}
225
+		//FIXME: This won't play nice with BOOL type false?
219 226
 
220 227
 		return $value;
221 228
 	}
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Title_Model.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,9 +35,13 @@
 block discarded – undo
35 35
 			$titleID = $id;
36 36
 		} else {
37 37
 			//TODO: Check if title is valid URL!
38
-			if($create) $titleID = $this->addTitle($titleURL, $siteID);
38
+			if($create) {
39
+				$titleID = $this->addTitle($titleURL, $siteID);
40
+			}
41
+		}
42
+		if(!isset($titleID) || !$titleID) {
43
+			$titleID = 0;
39 44
 		}
40
-		if(!isset($titleID) || !$titleID) $titleID = 0;
41 45
 
42 46
 		return ($returnData && $titleID !== 0 ? $query->row_array() : $titleID);
43 47
 	}
Please login to merge, or discard this patch.
application/core/MY_Controller.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 	protected $footer_data = array();
7 7
 	public    $global_data = array();
8 8
 
9
-	public function __construct(){
9
+	public function __construct() {
10 10
 		parent::__construct();
11 11
 
12 12
 		$this->load->driver('cache', array('adapter' => 'file', 'backup' => 'apc')); //Sadly we can't autoload this with params
@@ -88,7 +88,9 @@  discard block
 block discarded – undo
88 88
 	public function __construct() {
89 89
 		parent::__construct();
90 90
 
91
-		if($this->ion_auth->logged_in()) redirect('/');
91
+		if($this->ion_auth->logged_in()) {
92
+			redirect('/');
93
+		}
92 94
 	}
93 95
 }
94 96
 
Please login to merge, or discard this patch.
application/models/Tracker/Sites/WebToons.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,8 @@
 block discarded – undo
45 45
 
46 46
 		$content = $this->get_content($fullURL);
47 47
 		$data = $content['body'];
48
-		if($data !== 'Can\'t find the manga series.') { //FIXME: We should check for he proper error here.
48
+		if($data !== 'Can\'t find the manga series.') {
49
+//FIXME: We should check for he proper error here.
49 50
 			$xml = simplexml_load_string($data) or die("Error: Cannot create object");
50 51
 			if(isset($xml->{'channel'}->item[0])) {
51 52
 				$titleData['title'] = trim((string) $xml->{'channel'}->title);
Please login to merge, or discard this patch.
application/controllers/TitleHistory.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,9 @@
 block discarded – undo
17 17
 		$this->body_data['totalPages']  = $historyData['totalPages'];
18 18
 		$this->body_data['titleID']     = (int) $titleID;
19 19
 
20
-		if($page > $this->body_data['totalPages'] && $page > 1) redirect("/history/{$titleID}/1");
20
+		if($page > $this->body_data['totalPages'] && $page > 1) {
21
+			redirect("/history/{$titleID}/1");
22
+		}
21 23
 
22 24
 		$this->_render_page("TitleHistory");
23 25
 	}
Please login to merge, or discard this patch.
application/controllers/User/History.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,9 @@  discard block
 block discarded – undo
6 6
 	}
7 7
 
8 8
 	public function index(int $page = 1) : void {
9
-		if($page === 0) redirect('user/history/1');
9
+		if($page === 0) {
10
+			redirect('user/history/1');
11
+		}
10 12
 
11 13
 		$this->header_data['title'] = "History";
12 14
 		$this->header_data['page']  = "history";
@@ -16,7 +18,9 @@  discard block
 block discarded – undo
16 18
 		$this->body_data['currentPage'] = (int) $page;
17 19
 		$this->body_data['totalPages']  = $historyData['totalPages'];
18 20
 
19
-		if($page > $this->body_data['totalPages'] && $page > 1) redirect('user/history/1');
21
+		if($page > $this->body_data['totalPages'] && $page > 1) {
22
+			redirect('user/history/1');
23
+		}
20 24
 
21 25
 		$this->_render_page('User/History');
22 26
 	}
Please login to merge, or discard this patch.