Completed
Pull Request — master (#190)
by
unknown
03:42
created
application/core/MY_Output.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 MY_Output extends CI_Output {
4 4
 	protected $current_header = [
Please login to merge, or discard this patch.
application/models/Auth_Model.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -77,9 +77,9 @@
 block discarded – undo
77 77
 	public function verification_check(string $verificationCode) {
78 78
 		//user is trying to validate their email for signup, check if verification code is still valid/exists
79 79
 		$query = $this->db->select('email, verification_code_time')
80
-		                  ->from('auth_signup_verification')
81
-		                  ->where(array('verification_code' => $verificationCode))
82
-		                  ->get();
80
+						  ->from('auth_signup_verification')
81
+						  ->where(array('verification_code' => $verificationCode))
82
+						  ->get();
83 83
 
84 84
 		$return = FALSE;
85 85
 		if($query->num_rows() > 0) {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 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 Auth_Model extends CI_Model {
4 4
 	public function __construct() {
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 			}
61 61
 
62 62
 			$success = TRUE;
63
-		} catch (Exception $e) {
63
+		} catch(Exception $e) {
64 64
 			//echo 'Caught exception: ',  $e->getMessage(), "\n";
65 65
 
66 66
 			//revert verification
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 				//TODO: Remove from DB, send user error that verification expired.
92 92
 			} else {
93 93
 				//not expired, verification is valid, return email
94
-				$return =  $result->email;
94
+				$return = $result->email;
95 95
 			}
96 96
 		}
97 97
 		return $return;
Please login to merge, or discard this patch.
application/models/User_Model.php 5 patches
Spacing   +3 added lines, -3 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_Model extends CI_Model {
4 4
 	public $id;
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 			if($query->num_rows() > 0) {
72 72
 				//username exists, grab email
73 73
 				$email = $query->row('email');
74
-			}else{
74
+			} else {
75 75
 				//username doesn't exist, return FALSE
76 76
 				$email = FALSE;
77 77
 			}
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	public function get_new_api_key() : string {
104 104
 		$api_key = NULL;
105 105
 		if($this->logged_in()) {
106
-			$api_key = substr("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", mt_rand(0, 51), 1) . substr(md5((string) time()), 1);
106
+			$api_key = substr("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", mt_rand(0, 51), 1).substr(md5((string) time()), 1);
107 107
 
108 108
 			$this->db->where('id', $this->id);
109 109
 			$this->db->update('auth_users', ['api_key' => $api_key]);
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
 			if($query->num_rows() > 0) {
72 72
 				//username exists, grab email
73 73
 				$email = $query->row('email');
74
-			}else{
74
+			} else {
75 75
 				//username doesn't exist, return FALSE
76 76
 				$email = FALSE;
77 77
 			}
Please login to merge, or discard this 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 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_Model extends CI_Model {
4 4
 	public $id;
Please login to merge, or discard this patch.
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
 		$this->load->database();
41 41
 
42 42
 		$query = $this->db->select('*')
43
-		                  ->from('auth_users')
44
-		                  ->where('username', $username)
45
-		                  ->get();
43
+						  ->from('auth_users')
44
+						  ->where('username', $username)
45
+						  ->get();
46 46
 
47 47
 		return (bool) $query->num_rows();
48 48
 	}
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
 			$this->load->database();
65 65
 
66 66
 			$query = $this->db->select('email')
67
-			                  ->from('auth_users')
68
-			                  ->where('username', $identity)
69
-			                  ->get();
67
+							  ->from('auth_users')
68
+							  ->where('username', $identity)
69
+							  ->get();
70 70
 
71 71
 			if($query->num_rows() > 0) {
72 72
 				//username exists, grab email
@@ -84,9 +84,9 @@  discard block
 block discarded – undo
84 84
 		$user = NULL;
85 85
 
86 86
 		$query = $this->db->select('*')
87
-		                  ->from('auth_users')
88
-		                  ->where('username', $username)
89
-		                  ->get();
87
+						  ->from('auth_users')
88
+						  ->where('username', $username)
89
+						  ->get();
90 90
 
91 91
 		if($query->num_rows() > 0) {
92 92
 			$user = $query->row();
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
 	
115 115
 	public function get_id_from_api_key(string $api_key) {
116 116
 		$query = $this->db->select('id')
117
-		                  ->from('auth_users')
118
-		                  ->where('api_key', $api_key)
119
-		                  ->get();
117
+						  ->from('auth_users')
118
+						  ->where('api_key', $api_key)
119
+						  ->get();
120 120
 
121 121
 		if($query->num_rows() > 0) {
122 122
 			$userID = $query->row('id');
@@ -150,12 +150,12 @@  discard block
 block discarded – undo
150 150
 	}
151 151
 	public function hideLatestNotice() {
152 152
 		$idQuery = $this->db->select('1')
153
-		                    ->where('user_id', $this->User->id)
154
-		                    ->get('tracker_user_notices');
153
+							->where('user_id', $this->User->id)
154
+							->get('tracker_user_notices');
155 155
 		if($idQuery->num_rows() > 0) {
156 156
 			$success = (bool) $this->db->set('hidden_notice_id', '(SELECT id FROM tracker_notices ORDER BY id DESC LIMIT 1)', FALSE)
157
-			                           ->where('user_id', $this->User->id)
158
-			                           ->update('tracker_user_notices');
157
+									   ->where('user_id', $this->User->id)
158
+									   ->update('tracker_user_notices');
159 159
 		} else {
160 160
 			$success = (bool) $this->db->insert('tracker_user_notices', [
161 161
 				'user_id'           => $this->User->id,
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
 	/**
56 56
 	 * @param $identity
57 57
 	 *
58
-	 * @return mixed
58
+	 * @return boolean
59 59
 	 */
60 60
 	public function find_email_from_identity(string $identity) {
61 61
 		//login allows using email or username, but ion_auth doesn't support this
Please login to merge, or discard this patch.
application/config/email.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
 /*
4 4
 | -------------------------------------------------------------------
Please login to merge, or discard this patch.
application/config/migration.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-defined('BASEPATH') OR exit('No direct script access allowed');
2
+defined('BASEPATH') or exit('No direct script access allowed');
3 3
 
4 4
 /*
5 5
 |--------------------------------------------------------------------------
Please login to merge, or discard this patch.
application/config/testing/migration.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
 /*
4 4
 |--------------------------------------------------------------------------
Please login to merge, or discard this patch.
application/config/profiler.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-defined('BASEPATH') OR exit('No direct script access allowed');
2
+defined('BASEPATH') or exit('No direct script access allowed');
3 3
 
4 4
 /*
5 5
 | -------------------------------------------------------------------------
Please login to merge, or discard this patch.
application/config/user_agents.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-defined('BASEPATH') OR exit('No direct script access allowed');
2
+defined('BASEPATH') or exit('No direct script access allowed');
3 3
 
4 4
 /*
5 5
 | -------------------------------------------------------------------
Please login to merge, or discard this patch.
application/config/routes.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
 /*
4 4
 | -------------------------------------------------------------------------
Please login to merge, or discard this patch.