Passed
Pull Request — master (#24)
by Joseph
02:19
created
classes/subway-auth-redirect.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
 namespace Subway;
21 21
 
22
-if (! defined('ABSPATH') ) {
22
+if ( ! defined('ABSPATH')) {
23 23
     return;
24 24
 }
25 25
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
         $pwd = filter_input(INPUT_POST, 'pwd', FILTER_SANITIZE_STRING);
53 53
 
54
-        if (empty($log) && empty($pwd) ) {
54
+        if (empty($log) && empty($pwd)) {
55 55
 
56 56
             $response['type'] = 'error';
57 57
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 
67 67
             $response = array();
68 68
 
69
-            if (is_wp_error($is_signin) ) {
69
+            if (is_wp_error($is_signin)) {
70 70
 
71 71
                 $response['type'] = 'error';
72 72
 
@@ -105,24 +105,24 @@  discard block
 block discarded – undo
105 105
      * 
106 106
      * @return string              The final redirect url.
107 107
      */
108
-    public static function getLoginRedirectUrl( $redirect_to, $user ) 
108
+    public static function getLoginRedirectUrl($redirect_to, $user) 
109 109
     {
110 110
 
111 111
         $subway_redirect_type = get_option('subway_redirect_type');
112 112
 
113 113
         // Redirect the user to default behaviour.
114 114
         // If there are no redirect type option saved.
115
-        if (empty($subway_redirect_type) ) {
115
+        if (empty($subway_redirect_type)) {
116 116
 
117 117
             return $redirect_to;
118 118
 
119 119
         }
120 120
 
121
-        if ('default' === $subway_redirect_type ) {
121
+        if ('default' === $subway_redirect_type) {
122 122
             return $redirect_to;
123 123
         }
124 124
 
125
-        if ('page' === $subway_redirect_type ) {
125
+        if ('page' === $subway_redirect_type) {
126 126
 
127 127
             // Get the page url of the selected page.
128 128
             // If the admin selected 'Custom Page' in the redirect type settings.
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
             // Redirect to default WordPress behaviour.
132 132
             // If the user did not select page.
133
-            if (empty($selected_redirect_page) ) {
133
+            if (empty($selected_redirect_page)) {
134 134
 
135 135
                 return $redirect_to;
136 136
             }
@@ -139,14 +139,14 @@  discard block
 block discarded – undo
139 139
             // and let the user go into that page.
140 140
             return get_permalink($selected_redirect_page);
141 141
 
142
-        } elseif ('custom_url' === $subway_redirect_type ) {
142
+        } elseif ('custom_url' === $subway_redirect_type) {
143 143
 
144 144
             // Get the custom url saved in the redirect type settings.
145 145
             $entered_custom_url = get_option('subway_redirect_custom_url');
146 146
 
147 147
             // Redirect to default WordPress behaviour 
148 148
             // if the user did enter a custom url.
149
-            if (empty($entered_custom_url) ) {
149
+            if (empty($entered_custom_url)) {
150 150
 
151 151
                 return $redirect_to;
152 152
 
@@ -154,14 +154,14 @@  discard block
 block discarded – undo
154 154
 
155 155
             // Otherwise, get the custom url saved 
156 156
             // and let the user go into that page.
157
-            if (! empty($user->ID) ) {
157
+            if ( ! empty($user->ID)) {
158 158
                 $entered_custom_url = str_replace(
159 159
                     '%user_id%', $user->ID, 
160 160
                     $entered_custom_url
161 161
                 );
162 162
             }
163 163
 
164
-            if (! empty($user->user_login) ) {
164
+            if ( ! empty($user->user_login)) {
165 165
                 $entered_custom_url = str_replace(
166 166
                     '%user_name%', $user->user_login, 
167 167
                     $entered_custom_url
@@ -183,13 +183,13 @@  discard block
 block discarded – undo
183 183
      * 
184 184
      * @return string            The final login url.
185 185
      */
186
-    public static function loginUrl( $login_url  ) 
186
+    public static function loginUrl($login_url) 
187 187
     {
188 188
 
189 189
         $subway_login_page = Options::getRedirectPageUrl();
190 190
 
191 191
         // Return the default login url if there is no log-in page defined.
192
-        if (empty($subway_login_page) ) {
192
+        if (empty($subway_login_page)) {
193 193
             return $login_url;
194 194
         }
195 195
 
Please login to merge, or discard this patch.