@@ -230,7 +230,7 @@ |
||
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | if ( false !== $this->parent_li ) { |
| 233 | - ++$this->current_field_count; |
|
| 233 | + ++ $this->current_field_count; |
|
| 234 | 234 | $this->current_list_size += $this->active_field_size; |
| 235 | 235 | |
| 236 | 236 | if ( 12 === $this->current_list_size ) { |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | public function read_until( $char ) { |
| 53 | 53 | $value = ''; |
| 54 | 54 | |
| 55 | - while ( $this->pos <= $this->max && ( $one = $this->string[ $this->pos++ ] ) !== $char ) { |
|
| 55 | + while ( $this->pos <= $this->max && ( $one = $this->string[$this->pos ++] ) !== $char ) { |
|
| 56 | 56 | $value .= $one; |
| 57 | 57 | } |
| 58 | 58 | return $value; |
@@ -70,10 +70,10 @@ discard block |
||
| 70 | 70 | public function read( $count ) { |
| 71 | 71 | $value = ''; |
| 72 | 72 | |
| 73 | - while ( $count > 0 && $this->pos <= $this->max && ( ( $one = $this->string[ $this->pos ] ) || '0' === $one ) ) { |
|
| 73 | + while ( $count > 0 && $this->pos <= $this->max && ( ( $one = $this->string[$this->pos] ) || '0' === $one ) ) { |
|
| 74 | 74 | $value .= $one; |
| 75 | 75 | $this->pos += 1; |
| 76 | - --$count; |
|
| 76 | + -- $count; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | /** |
@@ -295,14 +295,14 @@ |
||
| 295 | 295 | $defaults = $this->get_defaults(); |
| 296 | 296 | |
| 297 | 297 | foreach ( $defaults as $val => $default ) { |
| 298 | - if ( isset( $values[ $val ] ) ) { |
|
| 298 | + if ( isset( $values[$val] ) ) { |
|
| 299 | 299 | if ( $default['sanitize'] === 'float' ) { |
| 300 | - $new_values[ $val ] = (float) $values[ $val ]; |
|
| 300 | + $new_values[$val] = (float) $values[$val]; |
|
| 301 | 301 | } elseif ( ! empty( $default['sanitize'] ) ) { |
| 302 | - $new_values[ $val ] = call_user_func( $default['sanitize'], $values[ $val ] ); |
|
| 302 | + $new_values[$val] = call_user_func( $default['sanitize'], $values[$val] ); |
|
| 303 | 303 | } |
| 304 | 304 | } elseif ( $values['action'] === 'create' ) { |
| 305 | - $new_values[ $val ] = $default['default']; |
|
| 305 | + $new_values[$val] = $default['default']; |
|
| 306 | 306 | } |
| 307 | 307 | } |
| 308 | 308 | } |
@@ -57,8 +57,8 @@ discard block |
||
| 57 | 57 | * @return void |
| 58 | 58 | */ |
| 59 | 59 | private static function flag_new_unique_key( $unique_id ) { |
| 60 | - if ( ! isset( self::$unique_id_match_checks[ $unique_id ] ) ) { |
|
| 61 | - self::$unique_id_match_checks[ $unique_id ] = false; |
|
| 60 | + if ( ! isset( self::$unique_id_match_checks[$unique_id] ) ) { |
|
| 61 | + self::$unique_id_match_checks[$unique_id] = false; |
|
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | 64 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | if ( 0 === (int) $meta->field_id ) { |
| 116 | 116 | continue; |
| 117 | 117 | } |
| 118 | - $field_metas[ $meta->field_id ] = $meta->meta_value; |
|
| 118 | + $field_metas[$meta->field_id] = $meta->meta_value; |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | $filtered_vals = array_filter( $values['item_meta'] ); |
@@ -183,8 +183,8 @@ discard block |
||
| 183 | 183 | return false; |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | - if ( isset( self::$unique_id_match_checks[ $unique_id ] ) ) { |
|
| 187 | - return self::$unique_id_match_checks[ $unique_id ]; |
|
| 186 | + if ( isset( self::$unique_id_match_checks[$unique_id] ) ) { |
|
| 187 | + return self::$unique_id_match_checks[$unique_id]; |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | $timestamp = strtotime( $created_at ); |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | $timestamp = time(); |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | - self::$unique_id_match_checks[ $unique_id ] = (bool) FrmDb::get_var( |
|
| 196 | + self::$unique_id_match_checks[$unique_id] = (bool) FrmDb::get_var( |
|
| 197 | 197 | 'frm_item_metas', |
| 198 | 198 | array( |
| 199 | 199 | 'field_id' => 0, |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | 'id' |
| 204 | 204 | ); |
| 205 | 205 | |
| 206 | - return self::$unique_id_match_checks[ $unique_id ]; |
|
| 206 | + return self::$unique_id_match_checks[$unique_id]; |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | /** |
@@ -237,11 +237,11 @@ discard block |
||
| 237 | 237 | |
| 238 | 238 | foreach ( $filter_vals as $field_id => $value ) { |
| 239 | 239 | $field = FrmFieldFactory::get_field_object( $field_id ); |
| 240 | - $reduced[ $field_id ] = $field->get_value_to_save( $value, array( 'entry_id' => $entry_id ) ); |
|
| 241 | - $reduced[ $field_id ] = $field->set_value_before_save( $reduced[ $field_id ] ); |
|
| 240 | + $reduced[$field_id] = $field->get_value_to_save( $value, array( 'entry_id' => $entry_id ) ); |
|
| 241 | + $reduced[$field_id] = $field->set_value_before_save( $reduced[$field_id] ); |
|
| 242 | 242 | |
| 243 | - if ( '' === $reduced[ $field_id ] || ( is_array( $reduced[ $field_id ] ) && 0 === count( $reduced[ $field_id ] ) ) ) { |
|
| 244 | - unset( $reduced[ $field_id ] ); |
|
| 243 | + if ( '' === $reduced[$field_id] || ( is_array( $reduced[$field_id] ) && 0 === count( $reduced[$field_id] ) ) ) { |
|
| 244 | + unset( $reduced[$field_id] ); |
|
| 245 | 245 | } |
| 246 | 246 | } |
| 247 | 247 | return $reduced; |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | private static function prepare_entries( &$entries ) { |
| 544 | 544 | foreach ( $entries as $k => $entry ) { |
| 545 | 545 | self::prepare_entry( $entry ); |
| 546 | - $entries[ $k ] = $entry; |
|
| 546 | + $entries[$k] = $entry; |
|
| 547 | 547 | } |
| 548 | 548 | } |
| 549 | 549 | |
@@ -575,20 +575,20 @@ discard block |
||
| 575 | 575 | FrmFieldsHelper::prepare_field_value( $meta_val->meta_value, $meta_val->type ); |
| 576 | 576 | |
| 577 | 577 | if ( $meta_val->item_id == $entry->id ) { |
| 578 | - $entry->metas[ $meta_val->field_id ] = $meta_val->meta_value; |
|
| 578 | + $entry->metas[$meta_val->field_id] = $meta_val->meta_value; |
|
| 579 | 579 | |
| 580 | 580 | if ( $include_key ) { |
| 581 | - $entry->metas[ $meta_val->field_key ] = $entry->metas[ $meta_val->field_id ]; |
|
| 581 | + $entry->metas[$meta_val->field_key] = $entry->metas[$meta_val->field_id]; |
|
| 582 | 582 | } |
| 583 | 583 | continue; |
| 584 | 584 | } |
| 585 | 585 | |
| 586 | 586 | // include sub entries in an array |
| 587 | - if ( ! isset( $entry->metas[ $meta_val->field_id ] ) ) { |
|
| 588 | - $entry->metas[ $meta_val->field_id ] = array(); |
|
| 587 | + if ( ! isset( $entry->metas[$meta_val->field_id] ) ) { |
|
| 588 | + $entry->metas[$meta_val->field_id] = array(); |
|
| 589 | 589 | } |
| 590 | 590 | |
| 591 | - $entry->metas[ $meta_val->field_id ][] = $meta_val->meta_value; |
|
| 591 | + $entry->metas[$meta_val->field_id][] = $meta_val->meta_value; |
|
| 592 | 592 | |
| 593 | 593 | unset( $meta_val ); |
| 594 | 594 | }//end foreach |
@@ -696,16 +696,16 @@ discard block |
||
| 696 | 696 | } |
| 697 | 697 | |
| 698 | 698 | foreach ( $metas as $m_key => $meta_val ) { |
| 699 | - if ( ! isset( $entries[ $meta_val->item_id ] ) ) { |
|
| 699 | + if ( ! isset( $entries[$meta_val->item_id] ) ) { |
|
| 700 | 700 | continue; |
| 701 | 701 | } |
| 702 | 702 | |
| 703 | - if ( ! isset( $entries[ $meta_val->item_id ]->metas ) ) { |
|
| 704 | - $entries[ $meta_val->item_id ]->metas = array(); |
|
| 703 | + if ( ! isset( $entries[$meta_val->item_id]->metas ) ) { |
|
| 704 | + $entries[$meta_val->item_id]->metas = array(); |
|
| 705 | 705 | } |
| 706 | 706 | |
| 707 | 707 | FrmFieldsHelper::prepare_field_value( $meta_val->meta_value, $meta_val->type ); |
| 708 | - $entries[ $meta_val->item_id ]->metas[ $meta_val->field_id ] = $meta_val->meta_value; |
|
| 708 | + $entries[$meta_val->item_id]->metas[$meta_val->field_id] = $meta_val->meta_value; |
|
| 709 | 709 | unset( $m_key, $meta_val ); |
| 710 | 710 | } |
| 711 | 711 | |
@@ -904,7 +904,7 @@ discard block |
||
| 904 | 904 | * @return mixed |
| 905 | 905 | */ |
| 906 | 906 | private static function get_entry_value( $values, $name, $default ) { |
| 907 | - return $values[ $name ] ?? $default; |
|
| 907 | + return $values[$name] ?? $default; |
|
| 908 | 908 | } |
| 909 | 909 | |
| 910 | 910 | /** |
@@ -1119,7 +1119,7 @@ discard block |
||
| 1119 | 1119 | global $frm_vars; |
| 1120 | 1120 | |
| 1121 | 1121 | if ( array_key_exists( 'captcha_scores', $frm_vars ) && array_key_exists( $form_id, $frm_vars['captcha_scores'] ) ) { |
| 1122 | - $captcha_score_meta = array( 'captcha_score' => $frm_vars['captcha_scores'][ $form_id ] ); |
|
| 1122 | + $captcha_score_meta = array( 'captcha_score' => $frm_vars['captcha_scores'][$form_id] ); |
|
| 1123 | 1123 | FrmEntryMeta::add_entry_meta( $entry_id, 0, '', maybe_serialize( $captcha_score_meta ) ); |
| 1124 | 1124 | } |
| 1125 | 1125 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | $_GET['page'] = 'formidable'; |
| 28 | 28 | |
| 29 | - $values = array( |
|
| 29 | + $values = array( |
|
| 30 | 30 | 'id' => FrmAppHelper::get_post_param( 'form_id', '', 'absint' ), |
| 31 | 31 | 'doing_ajax' => true, |
| 32 | 32 | ); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | ob_start(); |
| 52 | 52 | self::load_single_field( $field, $values ); |
| 53 | - $field_html[ absint( $field->id ) ] = ob_get_contents(); |
|
| 53 | + $field_html[absint( $field->id )] = ob_get_contents(); |
|
| 54 | 54 | ob_end_clean(); |
| 55 | 55 | }//end foreach |
| 56 | 56 | |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | foreach ( $opts as $opt_key => $opt ) { |
| 289 | 289 | if ( strpos( $opt, '|' ) !== false ) { |
| 290 | 290 | $vals = explode( '|', $opt ); |
| 291 | - $opts[ $opt_key ] = array( |
|
| 291 | + $opts[$opt_key] = array( |
|
| 292 | 292 | 'label' => trim( $vals[0] ), |
| 293 | 293 | 'value' => trim( $vals[1] ), |
| 294 | 294 | ); |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | |
| 305 | 305 | foreach ( $field['options'] as $opt_key => $opt ) { |
| 306 | 306 | if ( FrmFieldsHelper::is_other_opt( $opt_key ) ) { |
| 307 | - $other_array[ $opt_key ] = $opt; |
|
| 307 | + $other_array[$opt_key] = $opt; |
|
| 308 | 308 | } |
| 309 | 309 | unset( $opt_key, $opt ); |
| 310 | 310 | } |
@@ -349,18 +349,18 @@ discard block |
||
| 349 | 349 | $frm_settings = FrmAppHelper::get_settings(); |
| 350 | 350 | $field_types = FrmFieldTypeOptionData::get_field_types( $field['type'] ); |
| 351 | 351 | |
| 352 | - if ( ! isset( $all_field_types[ $field['type'] ] ) ) { |
|
| 352 | + if ( ! isset( $all_field_types[$field['type']] ) ) { |
|
| 353 | 353 | // Add fallback for an add-on field type that has been deactivated. |
| 354 | - $all_field_types[ $field['type'] ] = array( |
|
| 354 | + $all_field_types[$field['type']] = array( |
|
| 355 | 355 | 'name' => ucfirst( $field['type'] ), |
| 356 | 356 | 'icon' => 'frm_icon_font frm_pencil_icon', |
| 357 | 357 | ); |
| 358 | - } elseif ( ! is_array( $all_field_types[ $field['type'] ] ) ) { |
|
| 358 | + } elseif ( ! is_array( $all_field_types[$field['type']] ) ) { |
|
| 359 | 359 | // Fallback for fields added in a more basic way. |
| 360 | - FrmFormsHelper::prepare_field_type( $all_field_types[ $field['type'] ] ); |
|
| 360 | + FrmFormsHelper::prepare_field_type( $all_field_types[$field['type']] ); |
|
| 361 | 361 | } |
| 362 | 362 | |
| 363 | - $type_name = $all_field_types[ $field['type'] ]['name']; |
|
| 363 | + $type_name = $all_field_types[$field['type']]['name']; |
|
| 364 | 364 | |
| 365 | 365 | if ( $field['type'] === 'divider' && FrmField::is_option_true( $field, 'repeat' ) ) { |
| 366 | 366 | $type_name = $all_field_types['divider|repeat']['name']; |
@@ -439,14 +439,14 @@ discard block |
||
| 439 | 439 | |
| 440 | 440 | if ( FrmAppHelper::pro_is_connected() ) { |
| 441 | 441 | foreach ( $settings as $type ) { |
| 442 | - if ( ! empty( $field[ $type ] ) ) { |
|
| 442 | + if ( ! empty( $field[$type] ) ) { |
|
| 443 | 443 | $active = $type; |
| 444 | 444 | } |
| 445 | 445 | } |
| 446 | 446 | } |
| 447 | 447 | |
| 448 | - $types[ $active ]['class'] .= ' current'; |
|
| 449 | - $types[ $active ]['current'] = true; |
|
| 448 | + $types[$active]['class'] .= ' current'; |
|
| 449 | + $types[$active]['current'] = true; |
|
| 450 | 450 | |
| 451 | 451 | return $types; |
| 452 | 452 | } |
@@ -466,8 +466,8 @@ discard block |
||
| 466 | 466 | 'image' => 'url', |
| 467 | 467 | ); |
| 468 | 468 | |
| 469 | - if ( isset( $type_switch[ $type ] ) ) { |
|
| 470 | - $type = $type_switch[ $type ]; |
|
| 469 | + if ( isset( $type_switch[$type] ) ) { |
|
| 470 | + $type = $type_switch[$type]; |
|
| 471 | 471 | } |
| 472 | 472 | |
| 473 | 473 | $pro_fields = FrmField::pro_field_selection(); |
@@ -632,11 +632,11 @@ discard block |
||
| 632 | 632 | // include "col" for valid html |
| 633 | 633 | $unit = trim( preg_replace( '/[0-9]+/', '', $field['size'] ) ); |
| 634 | 634 | |
| 635 | - if ( ! isset( $calc[ $unit ] ) ) { |
|
| 635 | + if ( ! isset( $calc[$unit] ) ) { |
|
| 636 | 636 | return; |
| 637 | 637 | } |
| 638 | 638 | |
| 639 | - $size = (float) str_replace( $unit, '', $field['size'] ) / $calc[ $unit ]; |
|
| 639 | + $size = (float) str_replace( $unit, '', $field['size'] ) / $calc[$unit]; |
|
| 640 | 640 | |
| 641 | 641 | $add_html['cols'] = 'cols="' . absint( $size ) . '"'; |
| 642 | 642 | } |
@@ -892,12 +892,12 @@ discard block |
||
| 892 | 892 | global $frm_vars; |
| 893 | 893 | |
| 894 | 894 | if ( ! empty( $frm_vars['js_validate_forms'] ) ) { |
| 895 | - if ( isset( $frm_vars['js_validate_forms'][ $field['form_id'] ] ) ) { |
|
| 896 | - return $frm_vars['js_validate_forms'][ $field['form_id'] ]; |
|
| 895 | + if ( isset( $frm_vars['js_validate_forms'][$field['form_id']] ) ) { |
|
| 896 | + return $frm_vars['js_validate_forms'][$field['form_id']]; |
|
| 897 | 897 | } |
| 898 | 898 | |
| 899 | - if ( ! empty( $field['parent_form_id'] ) && isset( $frm_vars['js_validate_forms'][ $field['parent_form_id'] ] ) ) { |
|
| 900 | - return $frm_vars['js_validate_forms'][ $field['parent_form_id'] ]; |
|
| 899 | + if ( ! empty( $field['parent_form_id'] ) && isset( $frm_vars['js_validate_forms'][$field['parent_form_id']] ) ) { |
|
| 900 | + return $frm_vars['js_validate_forms'][$field['parent_form_id']]; |
|
| 901 | 901 | } |
| 902 | 902 | } |
| 903 | 903 | return false; |
@@ -991,13 +991,13 @@ discard block |
||
| 991 | 991 | if ( isset( $field['subfield_name'] ) && 0 === strpos( $k, 'aria-invalid' ) ) { |
| 992 | 992 | $subfield_name = $field['subfield_name']; |
| 993 | 993 | |
| 994 | - if ( ! isset( $field['shortcodes'][ 'aria-invalid-' . $subfield_name ] ) ) { |
|
| 994 | + if ( ! isset( $field['shortcodes']['aria-invalid-' . $subfield_name] ) ) { |
|
| 995 | 995 | continue; |
| 996 | 996 | } |
| 997 | 997 | // Change the key to the correct aria-invalid value so that $add_html is set correctly for the current subfield of a combo field. |
| 998 | 998 | $k = 'aria-invalid'; |
| 999 | - $v = $field['shortcodes'][ 'aria-invalid-' . $subfield_name ]; |
|
| 1000 | - unset( $field['shortcodes'][ 'aria-invalid-' . $subfield_name ] ); |
|
| 999 | + $v = $field['shortcodes']['aria-invalid-' . $subfield_name]; |
|
| 1000 | + unset( $field['shortcodes']['aria-invalid-' . $subfield_name] ); |
|
| 1001 | 1001 | } |
| 1002 | 1002 | |
| 1003 | 1003 | if ( 'opt' === $k || ! self::should_allow_input_attribute( $k ) ) { |
@@ -1006,10 +1006,10 @@ discard block |
||
| 1006 | 1006 | |
| 1007 | 1007 | if ( is_numeric( $k ) && strpos( $v, '=' ) ) { |
| 1008 | 1008 | $add_html[] = $v; |
| 1009 | - } elseif ( ! empty( $k ) && isset( $add_html[ $k ] ) ) { |
|
| 1010 | - $add_html[ $k ] = str_replace( $k . '="', $k . '="' . $v, $add_html[ $k ] ); |
|
| 1009 | + } elseif ( ! empty( $k ) && isset( $add_html[$k] ) ) { |
|
| 1010 | + $add_html[$k] = str_replace( $k . '="', $k . '="' . $v, $add_html[$k] ); |
|
| 1011 | 1011 | } else { |
| 1012 | - $add_html[ $k ] = $k . '="' . esc_attr( $v ) . '"'; |
|
| 1012 | + $add_html[$k] = $k . '="' . esc_attr( $v ) . '"'; |
|
| 1013 | 1013 | } |
| 1014 | 1014 | |
| 1015 | 1015 | unset( $k, $v ); |
@@ -25,14 +25,14 @@ discard block |
||
| 25 | 25 | $buffer = ''; |
| 26 | 26 | |
| 27 | 27 | while ( $i < $length ) { |
| 28 | - $char = $css[ $i ]; |
|
| 28 | + $char = $css[$i]; |
|
| 29 | 29 | |
| 30 | 30 | if ( '@' === $char ) { |
| 31 | 31 | $brace_pos = strpos( $css, '{', $i ); |
| 32 | 32 | |
| 33 | 33 | if ( false === $brace_pos ) { |
| 34 | 34 | $buffer .= $char; |
| 35 | - ++$i; |
|
| 35 | + ++ $i; |
|
| 36 | 36 | continue; |
| 37 | 37 | } |
| 38 | 38 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | }//end if |
| 85 | 85 | |
| 86 | 86 | $buffer .= $char; |
| 87 | - ++$i; |
|
| 87 | + ++ $i; |
|
| 88 | 88 | }//end while |
| 89 | 89 | |
| 90 | 90 | return implode( '', $output ); |
@@ -112,14 +112,14 @@ discard block |
||
| 112 | 112 | $prefix_length = strlen( $prefix ); |
| 113 | 113 | |
| 114 | 114 | while ( $i < $length ) { |
| 115 | - $char = $css[ $i ]; |
|
| 115 | + $char = $css[$i]; |
|
| 116 | 116 | |
| 117 | 117 | if ( '@' === $char ) { |
| 118 | 118 | $brace_pos = strpos( $css, '{', $i ); |
| 119 | 119 | |
| 120 | 120 | if ( false === $brace_pos ) { |
| 121 | 121 | $buffer .= $char; |
| 122 | - ++$i; |
|
| 122 | + ++ $i; |
|
| 123 | 123 | |
| 124 | 124 | continue; |
| 125 | 125 | } |
@@ -147,9 +147,9 @@ discard block |
||
| 147 | 147 | |
| 148 | 148 | if ( '' !== $selector && '' !== trim( $declarations ) ) { |
| 149 | 149 | // Handle multiple selectors |
| 150 | - $selectors = array_filter( |
|
| 150 | + $selectors = array_filter( |
|
| 151 | 151 | array_map( 'trim', explode( ',', $selector ) ), |
| 152 | - function ( $s ) { |
|
| 152 | + function( $s ) { |
|
| 153 | 153 | return '' !== $s; |
| 154 | 154 | } |
| 155 | 155 | ); |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | }//end if |
| 173 | 173 | |
| 174 | 174 | $buffer .= $char; |
| 175 | - ++$i; |
|
| 175 | + ++ $i; |
|
| 176 | 176 | }//end while |
| 177 | 177 | return implode( '', $output ); |
| 178 | 178 | } |
@@ -228,11 +228,11 @@ discard block |
||
| 228 | 228 | $in_string = false; |
| 229 | 229 | $string_char = ''; |
| 230 | 230 | |
| 231 | - for ( $i = $open_pos + 1; $i < $length; $i++ ) { |
|
| 232 | - $char = $css[ $i ]; |
|
| 231 | + for ( $i = $open_pos + 1; $i < $length; $i ++ ) { |
|
| 232 | + $char = $css[$i]; |
|
| 233 | 233 | |
| 234 | 234 | // Handle string literals to avoid matching braces inside strings |
| 235 | - if ( ( '"' === $char || "'" === $char ) && ( 0 === $i || '\\' !== $css[ $i - 1 ] ) ) { |
|
| 235 | + if ( ( '"' === $char || "'" === $char ) && ( 0 === $i || '\\' !== $css[$i - 1] ) ) { |
|
| 236 | 236 | if ( ! $in_string ) { |
| 237 | 237 | $in_string = true; |
| 238 | 238 | $string_char = $char; |
@@ -248,9 +248,9 @@ discard block |
||
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | if ( '{' === $char ) { |
| 251 | - ++$level; |
|
| 251 | + ++ $level; |
|
| 252 | 252 | } elseif ( '}' === $char ) { |
| 253 | - --$level; |
|
| 253 | + -- $level; |
|
| 254 | 254 | |
| 255 | 255 | if ( 0 === $level ) { |
| 256 | 256 | return $i; |
@@ -88,7 +88,7 @@ |
||
| 88 | 88 | // Get posted data. |
| 89 | 89 | $plugin_slug = FrmAppHelper::get_post_param( 'plugin', '', 'sanitize_text_field' ); |
| 90 | 90 | |
| 91 | - if ( ! empty( get_plugins()[ $plugin_slug ] ) ) { |
|
| 91 | + if ( ! empty( get_plugins()[$plugin_slug] ) ) { |
|
| 92 | 92 | $activate = activate_plugin( $plugin_slug ); |
| 93 | 93 | } else { |
| 94 | 94 | // Include necessary files for plugin installation. |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | if ( $intent_is_processing ) { |
| 63 | 63 | // Append an additional processing message to the end of the success message. |
| 64 | - $filter = function ( $message ) { |
|
| 64 | + $filter = function( $message ) { |
|
| 65 | 65 | $stripe_settings = FrmStrpLiteAppHelper::get_settings(); |
| 66 | 66 | return $message . ( '<p>' . esc_html( $stripe_settings->settings->processing_message ) . '</p>' ); |
| 67 | 67 | }; |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | $atts['form'] = FrmForm::getOne( $atts['entry']->form_id ); |
| 171 | 171 | $atts['entry_id'] = $atts['entry']->id; |
| 172 | 172 | $opt = 'success_action'; |
| 173 | - $atts['conf_method'] = ! empty( $atts['form']->options[ $opt ] ) ? $atts['form']->options[ $opt ] : 'message'; |
|
| 173 | + $atts['conf_method'] = ! empty( $atts['form']->options[$opt] ) ? $atts['form']->options[$opt] : 'message'; |
|
| 174 | 174 | |
| 175 | 175 | $actions = FrmFormsController::get_met_on_submit_actions( $atts, 'create' ); |
| 176 | 176 | |
@@ -268,11 +268,11 @@ discard block |
||
| 268 | 268 | */ |
| 269 | 269 | public static function get_payment_intents( $name ) { |
| 270 | 270 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 271 | - if ( ! isset( $_POST[ $name ] ) ) { |
|
| 271 | + if ( ! isset( $_POST[$name] ) ) { |
|
| 272 | 272 | return array(); |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | - $intents = $_POST[ $name ]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 275 | + $intents = $_POST[$name]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 276 | 276 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $intents ); |
| 277 | 277 | return $intents; |
| 278 | 278 | } |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | self::format_form_data( $form ); |
| 301 | 301 | |
| 302 | 302 | $form_id = absint( $form['form_id'] ); |
| 303 | - $intents = $form[ 'frmintent' . $form_id ] ?? array(); |
|
| 303 | + $intents = $form['frmintent' . $form_id] ?? array(); |
|
| 304 | 304 | |
| 305 | 305 | if ( empty( $intents ) ) { |
| 306 | 306 | wp_die(); |
@@ -310,8 +310,8 @@ discard block |
||
| 310 | 310 | $intents = array( $intents ); |
| 311 | 311 | } else { |
| 312 | 312 | foreach ( $intents as $k => $intent ) { |
| 313 | - if ( is_array( $intent ) && isset( $intent[ $k ] ) ) { |
|
| 314 | - $intents[ $k ] = $intent[ $k ]; |
|
| 313 | + if ( is_array( $intent ) && isset( $intent[$k] ) ) { |
|
| 314 | + $intents[$k] = $intent[$k]; |
|
| 315 | 315 | } |
| 316 | 316 | } |
| 317 | 317 | } |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | if ( $saved->metadata->action != $action->ID ) { |
| 374 | 374 | continue; |
| 375 | 375 | } |
| 376 | - $intents[ $k ] = array( |
|
| 376 | + $intents[$k] = array( |
|
| 377 | 377 | 'id' => $intent, |
| 378 | 378 | 'action' => $action->ID, |
| 379 | 379 | ); |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | if ( $k === 'item_meta' ) { |
| 421 | 421 | foreach ( $v as $f => $value ) { |
| 422 | 422 | FrmAppHelper::sanitize_value( 'wp_kses_post', $value ); |
| 423 | - $entry->metas[ absint( $f ) ] = $value; |
|
| 423 | + $entry->metas[absint( $f )] = $value; |
|
| 424 | 424 | } |
| 425 | 425 | } else { |
| 426 | 426 | FrmAppHelper::sanitize_value( 'wp_kses_post', $v ); |
@@ -446,14 +446,14 @@ discard block |
||
| 446 | 446 | foreach ( $form as $input ) { |
| 447 | 447 | $key = $input['name']; |
| 448 | 448 | |
| 449 | - if ( isset( $formatted[ $key ] ) ) { |
|
| 450 | - if ( is_array( $formatted[ $key ] ) ) { |
|
| 451 | - $formatted[ $key ][] = $input['value']; |
|
| 449 | + if ( isset( $formatted[$key] ) ) { |
|
| 450 | + if ( is_array( $formatted[$key] ) ) { |
|
| 451 | + $formatted[$key][] = $input['value']; |
|
| 452 | 452 | } else { |
| 453 | - $formatted[ $key ] = array( $formatted[ $key ], $input['value'] ); |
|
| 453 | + $formatted[$key] = array( $formatted[$key], $input['value'] ); |
|
| 454 | 454 | } |
| 455 | 455 | } else { |
| 456 | - $formatted[ $key ] = $input['value']; |
|
| 456 | + $formatted[$key] = $input['value']; |
|
| 457 | 457 | } |
| 458 | 458 | } |
| 459 | 459 | |
@@ -705,7 +705,7 @@ discard block |
||
| 705 | 705 | |
| 706 | 706 | foreach ( $actions as $k => $action ) { |
| 707 | 707 | $amount = self::get_amount_before_submit( compact( 'action', 'form' ) ); |
| 708 | - $actions[ $k ]->post_content['amount'] = $amount; |
|
| 708 | + $actions[$k]->post_content['amount'] = $amount; |
|
| 709 | 709 | } |
| 710 | 710 | } |
| 711 | 711 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public static function show_status( $status ) { |
| 71 | 71 | $statuses = array_merge( self::get_payment_statuses(), self::get_subscription_statuses() ); |
| 72 | - return $statuses[ $status ] ?? $status; |
|
| 72 | + return $statuses[$status] ?? $status; |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /** |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | */ |
| 160 | 160 | public static function get_action_setting( $option, $atts ) { |
| 161 | 161 | $settings = self::get_action_settings( $atts ); |
| 162 | - return $settings[ $option ] ?? ''; |
|
| 162 | + return $settings[$option] ?? ''; |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | /** |
@@ -271,8 +271,8 @@ discard block |
||
| 271 | 271 | public static function get_repeat_label_from_value( $value, $number ) { |
| 272 | 272 | $times = self::get_plural_repeat_times( $number ); |
| 273 | 273 | |
| 274 | - if ( isset( $times[ $value ] ) ) { |
|
| 275 | - $value = $times[ $value ]; |
|
| 274 | + if ( isset( $times[$value] ) ) { |
|
| 275 | + $value = $times[$value]; |
|
| 276 | 276 | } |
| 277 | 277 | return $value; |
| 278 | 278 | } |
@@ -541,7 +541,7 @@ discard block |
||
| 541 | 541 | |
| 542 | 542 | foreach ( $payments as $payment ) { |
| 543 | 543 | if ( $payment->status === 'complete' ) { |
| 544 | - $count++; |
|
| 544 | + $count ++; |
|
| 545 | 545 | } |
| 546 | 546 | } |
| 547 | 547 | |
@@ -569,8 +569,8 @@ discard block |
||
| 569 | 569 | $gateway = reset( $gateway ); |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | - if ( isset( $gateways[ $gateway ] ) ) { |
|
| 573 | - $value = $gateways[ $gateway ][ $setting ]; |
|
| 572 | + if ( isset( $gateways[$gateway] ) ) { |
|
| 573 | + $value = $gateways[$gateway][$setting]; |
|
| 574 | 574 | } |
| 575 | 575 | return $value; |
| 576 | 576 | } |