@@ -15,10 +15,8 @@ |
||
| 15 | 15 | * |
| 16 | 16 | * @internal |
| 17 | 17 | */ |
| 18 | -class DummyTest |
|
| 19 | -{ |
|
| 20 | - public function __toString() |
|
| 21 | - { |
|
| 18 | +class DummyTest { |
|
| 19 | + public function __toString() { |
|
| 22 | 20 | return 'DummyTest'; |
| 23 | 21 | } |
| 24 | 22 | } |
@@ -11,8 +11,7 @@ |
||
| 11 | 11 | /** |
| 12 | 12 | * Describes log levels. |
| 13 | 13 | */ |
| 14 | -class LogLevel |
|
| 15 | -{ |
|
| 14 | +class LogLevel { |
|
| 16 | 15 | const EMERGENCY = 'emergency'; |
| 17 | 16 | const ALERT = 'alert'; |
| 18 | 17 | const CRITICAL = 'critical'; |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | |
| 167 | 167 | $new_role = add_role( $new_role_slug, $role_display_name, $capabilities ); |
| 168 | 168 | |
| 169 | - if ( ! $new_role ){ |
|
| 169 | + if ( ! $new_role ) { |
|
| 170 | 170 | |
| 171 | 171 | return new WP_Error( |
| 172 | 172 | 'add_role_failed', |
@@ -181,9 +181,9 @@ discard block |
||
| 181 | 181 | |
| 182 | 182 | $remove_caps = $this->config->get_setting( 'caps/remove' ); |
| 183 | 183 | |
| 184 | - if ( ! empty( $remove_caps ) ){ |
|
| 184 | + if ( ! empty( $remove_caps ) ) { |
|
| 185 | 185 | |
| 186 | - foreach ( $remove_caps as $remove_cap => $description ){ |
|
| 186 | + foreach ( $remove_caps as $remove_cap => $description ) { |
|
| 187 | 187 | $new_role->remove_cap( $remove_cap ); |
| 188 | 188 | $this->logging->log( 'Capability '. $remove_cap .' removed from role.', __METHOD__, 'info' ); |
| 189 | 189 | } |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | $user_identifier = $passed_user_identifier; |
| 85 | 85 | |
| 86 | - if ( $this->in_lockdown() ){ |
|
| 86 | + if ( $this->in_lockdown() ) { |
|
| 87 | 87 | |
| 88 | 88 | $this->logging->log( 'Site is in lockdown mode, aborting login.', __METHOD__, 'error' ); |
| 89 | 89 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | $approved = $this->check_approved_identifier( $secret_id ); |
| 112 | 112 | |
| 113 | 113 | // Don't lock-down the site, since there could have been errors related to remote validation |
| 114 | - if ( is_wp_error( $approved ) ){ |
|
| 114 | + if ( is_wp_error( $approved ) ) { |
|
| 115 | 115 | |
| 116 | 116 | $this->logging->log( |
| 117 | 117 | sprintf( |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | |
| 303 | 303 | $notified = $this->report_lockdown(); |
| 304 | 304 | |
| 305 | - if ( is_wp_error( $notified ) ){ |
|
| 305 | + if ( is_wp_error( $notified ) ) { |
|
| 306 | 306 | $this->logging->log( sprintf( 'Could not notify TrustedLogin (%s)', $notified->get_error_message() ), __METHOD__, 'error' ); |
| 307 | 307 | } |
| 308 | 308 | |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | * |
| 356 | 356 | * @return int|false Int: in lockdown. The value returned is the timestamp when lockdown ends. False: not in lockdown, or overridden by a constant. |
| 357 | 357 | */ |
| 358 | - public function in_lockdown(){ |
|
| 358 | + public function in_lockdown() { |
|
| 359 | 359 | |
| 360 | 360 | if ( $this->in_local_development() ) { |
| 361 | 361 | return false; |
@@ -81,13 +81,13 @@ |
||
| 81 | 81 | |
| 82 | 82 | $e_keys = $this->encryption->generate_keys(); |
| 83 | 83 | |
| 84 | - if ( is_wp_error( $e_keys ) ){ |
|
| 84 | + if ( is_wp_error( $e_keys ) ) { |
|
| 85 | 85 | return $e_keys; |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | $nonce = $this->encryption->get_nonce(); |
| 89 | 89 | |
| 90 | - if ( is_wp_error( $nonce ) ){ |
|
| 90 | + if ( is_wp_error( $nonce ) ) { |
|
| 91 | 91 | return $nonce; |
| 92 | 92 | } |
| 93 | 93 | |
@@ -251,7 +251,7 @@ |
||
| 251 | 251 | |
| 252 | 252 | if ( is_wp_error( $response_json ) ) { |
| 253 | 253 | |
| 254 | - if ( 'not_found' == $response_json->get_error_code() ){ |
|
| 254 | + if ( 'not_found' == $response_json->get_error_code() ) { |
|
| 255 | 255 | return new WP_Error( 'not_found', __( 'Encryption key could not be fetched, Vendor site returned 404.', 'gravityview' ) ); |
| 256 | 256 | } |
| 257 | 257 | |
@@ -90,7 +90,7 @@ |
||
| 90 | 90 | |
| 91 | 91 | $unschedule_expiration = wp_clear_scheduled_hook( $this->hook_name, array( $site_identifier_hash ) ); |
| 92 | 92 | |
| 93 | - if ( false === $unschedule_expiration ){ |
|
| 93 | + if ( false === $unschedule_expiration ) { |
|
| 94 | 94 | $this->logging->log( sprintf( 'Could not unschedule event for %s', $this->hook_name ), __METHOD__, 'error' ); |
| 95 | 95 | return false; |
| 96 | 96 | } |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | * |
| 53 | 53 | * @return array Blocklist, with "total" added. If not edit context, original field blocklist. Otherwise, blocklist including total. |
| 54 | 54 | */ |
| 55 | - public function add_to_blocklist( $blocklist = array(), $context = NULL ){ |
|
| 55 | + public function add_to_blocklist( $blocklist = array(), $context = NULL ) { |
|
| 56 | 56 | |
| 57 | 57 | if( empty( $context ) || $context !== 'edit' ) { |
| 58 | 58 | return $blocklist; |
@@ -700,7 +700,8 @@ discard block |
||
| 700 | 700 | |
| 701 | 701 | // Only allow quantity to be set if it's allowed to be edited |
| 702 | 702 | if ( in_array( $field_id, $allowed_fields ) && $input_id == 3 ) { |
| 703 | - } else { // otherwise set to what it previously was |
|
| 703 | + } else { |
|
| 704 | +// otherwise set to what it previously was |
|
| 704 | 705 | $_POST[ $input_name ] = $entry[ $input['id'] ]; |
| 705 | 706 | } |
| 706 | 707 | } else { |
@@ -1164,7 +1165,7 @@ discard block |
||
| 1164 | 1165 | |
| 1165 | 1166 | $back_link = remove_query_arg( array( 'page', 'view', 'edit' ) ); |
| 1166 | 1167 | |
| 1167 | - if( ! $this->is_valid ){ |
|
| 1168 | + if( ! $this->is_valid ) { |
|
| 1168 | 1169 | |
| 1169 | 1170 | // Keeping this compatible with Gravity Forms. |
| 1170 | 1171 | $validation_message = "<div class='validation_error'>" . __('There was a problem with your submission.', 'gravityview') . " " . __('Errors have been highlighted below.', 'gravityview') . "</div>"; |
@@ -2454,9 +2455,7 @@ discard block |
||
| 2454 | 2455 | // Verify |
| 2455 | 2456 | else if( ! $this->is_edit_entry() ) { |
| 2456 | 2457 | $valid = false; |
| 2457 | - } |
|
| 2458 | - |
|
| 2459 | - else { |
|
| 2458 | + } else { |
|
| 2460 | 2459 | $valid = wp_verify_nonce( $_GET['edit'], self::$nonce_key ); |
| 2461 | 2460 | } |
| 2462 | 2461 | |