Skip to content

Commit a5aeb5d

Browse files
committed
Formatting: PHPCS automatic fixes.
1 parent aae6f55 commit a5aeb5d

17 files changed

+42
-41
lines changed

experimental/gpeb-use-select-for-country-filter.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,21 @@
2727
$country_choices = array_map( function ( $country ) {
2828
return array(
2929
'text' => $country,
30-
'value' => $country
30+
'value' => $country,
3131
);
3232
}, $field['gpebFilterInputField']->get_countries() );
3333

3434
// Change the field to a select and populate it with countries from the address field.
3535
$new_field = new \GF_Field_Select( array(
36-
'id' => $field['id'],
37-
'label' => $field['label'],
38-
'gpebFilterSearch' => $field['gpebFilterSearch'],
36+
'id' => $field['id'],
37+
'label' => $field['label'],
38+
'gpebFilterSearch' => $field['gpebFilterSearch'],
3939
'gpebFilterInputField' => $field['gpebFilterInputField'],
40-
'size' => $field['size'],
41-
'inputs' => $field['inputs'],
42-
'formId' => $field['formId'],
43-
'type' => 'select',
44-
'choices' => $country_choices
40+
'size' => $field['size'],
41+
'inputs' => $field['inputs'],
42+
'formId' => $field['formId'],
43+
'type' => 'select',
44+
'choices' => $country_choices,
4545
) );
4646
return $new_field;
4747
}

experimental/gspc-set-subscription-length-by-field-value.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
add_action( 'woocommerce_checkout_create_subscription', function ( $subscription ) {
77

88
// Update "123" to the ID of the form attached to the Subscription product.
9-
$target_form_id = 123;
10-
9+
$target_form_id = 123;
10+
1111
// Update "4" to the field ID that will determine the subscription length (in months).
1212
$sub_length_field_id = 4;
1313

@@ -16,7 +16,7 @@
1616
foreach ( $subscription_items as $subscription_item ) {
1717

1818
$gspc_order_item = new GS_Product_Configurator\WC_Order_Item( $subscription_item );
19-
$entries = $gspc_order_item->get_entries();
19+
$entries = $gspc_order_item->get_entries();
2020
if ( empty( $entries ) || rgars( $entries, '0/form_id' ) != $target_form_id ) {
2121
continue;
2222
}

gp-advanced-select/gpadvs-enable-add-new-option.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,5 +241,5 @@ public function disable_state_validation_for_advanced_select_field( $form ) {
241241

242242
new GPASVS_Enable_Add_New_Option(array(
243243
'form_id' => 123,
244-
// 'field_id' => 4,
244+
// 'field_id' => 4,
245245
));

gp-easy-passthrough/gpep-delete-token-after-72-hours.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
// Check if the entry was created more than 72 hours ago
3434
$date_created = strtotime( $entry['date_created'] );
35-
$hours_diff = ( time() - $date_created ) / 3600;
35+
$hours_diff = ( time() - $date_created ) / 3600;
3636

3737
if ( $hours_diff > 72 ) {
3838
// Delete the EP token meta from the entry.

gp-entry-blocks/gpeb-show-entry-count.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function gpeb_show_entry_count( $block_content, $block, $instance ) {
2828

2929
// Display the count before and after the table.
3030
$entry_label = _n( 'entry', 'entries', $queryer->total_count, 'gp-entry-blocks' );
31-
$count = '<div class="gpeb-entry-count"><span>' . $queryer->total_count . '</span> ' . $entry_label . ' found.</div>';
31+
$count = '<div class="gpeb-entry-count"><span>' . $queryer->total_count . '</span> ' . $entry_label . ' found.</div>';
3232

3333
// If you want it to show before the table
3434
// return $count . $block_content;

gp-file-renamer/gpfr-remove-spaces-and-dashes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
$directory_path = dirname( $renamed_file );
99
$filename = basename( $renamed_file );
10-
$modified_filename = str_replace( '-', '', $filename);
10+
$modified_filename = str_replace( '-', '', $filename );
1111

1212
return $directory_path . '/' . $modified_filename;
1313
}, 10, 5 );

gp-inventory/gpi-populate-total-inventory-available.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
$limit = (int) $choice['inventory_limit'];
3131
$count = (int) rgar( $choice_counts, $choice['value'] );
3232
$available = $limit - $count;
33-
$total_available += $available;;
33+
$total_available += $available;
34+
3435
}
3536

3637
return $total_available;

gp-limit-submissions/gpls-set-limit-by-user-meta.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
// Update "123" to your form ID.
77
add_filter( 'gpls_rule_groups_123', function ( $rule_groups ) {
8-
// Update "my_meta_key" to the meta key that should contain the number of times the form can be submitted.
8+
// Update "my_meta_key" to the meta key that should contain the number of times the form can be submitted.
99
$rule_groups[0]->limit = (int) get_user_meta( get_current_user_id(), 'my_meta_key', true );
1010
return $rule_groups;
1111
} );

gp-nested-forms/gpnf-display-child-entries-as-columns.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* Requires the Display Table Format for All Fields snippet and only works if the `:gpnf_table` modifier is set on the
1212
* {all_fields} merge tag or Nested Form field merge tag.
13-
*
13+
*
1414
* [Display Table Format for All Fields](https://github.com/gravitywiz/snippet-library/blob/master/gp-nested-forms/gpnf-display-child-entries-table-format.php)
1515
*/
1616
add_filter( 'gp_template_output_nested-entries-detail-simple', function( $markup, $located_template, $load, $args ) {
@@ -52,12 +52,13 @@
5252
<?php echo GFCommon::get_label( $nested_field ); ?>
5353
</th>
5454
<?php foreach ( $entries as $entry ) : ?>
55-
<?php $field_values = gp_nested_forms()->get_entry_display_values( $entry, $nested_form, $nested_field_ids );
55+
<?php
56+
$field_values = gp_nested_forms()->get_entry_display_values( $entry, $nested_form, $nested_field_ids );
5657
$field_value = rgars( $field_values, "{$nested_field['id']}/label" );
57-
?>
58+
?>
5859
<td class="gpnf-field"
59-
data-heading="<?php echo GFCommon::get_label( $nested_field ); ?>"
60-
data-value="<?php echo esc_attr( $field_value ); ?>">
60+
data-heading="<?php echo GFCommon::get_label( $nested_field ); ?>"
61+
data-value="<?php echo esc_attr( $field_value ); ?>">
6162
<?php echo $field_value; ?>
6263
</td>
6364
<?php endforeach; ?>

gp-nested-forms/gpnf-parse-parent-merge-tags-in-webhooks.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
/**
33
* Gravity Perks // Nested Forms // Parse Parent Merge Tags for Webhooks Add-on
44
* https://gravitywiz.com/documentation/gravity-forms-nested-forms/
5-
*
5+
*
66
* Note: Merge tags must be specified in their "complicated" format to avoid being processed prematurely in the child form context.
77
* Example: {Parent:2} → {%GPNF:Parent:2%}
88
*/
99
add_filter( 'gform_webhooks_request_data', function( $request_data, $feed, $entry, $form ) {
1010

11-
foreach( $request_data as $key => &$value ) {
11+
foreach ( $request_data as $key => &$value ) {
1212
$value = gpnf_parent_merge_tag()->parse_parent_merge_tag( $value, $form, $entry, true, true, false, 'text' );
1313
}
1414

gp-populate-anything/gppa-acf-repeater-mapper.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737
foreach ( $field->{'gppa-choices-templates'} as $template => $key ) {
3838
/**
3939
* Look for ACF repeater meta: repeater_name_0_subfield_name
40-
*
40+
*
4141
* Known limitation: This cannot have a number on the repeater field name. For an enumerator, it is
4242
* recommended to use alphabets like, repeater_name_a_0_name, repeater_name_b_1_name,etc.
43-
*/
43+
*/
4444
if ( preg_match( '/meta_([^0-9]+)_([0-9]+)_(.+)/', $key, $matches ) ) {
4545
list( , $repeater, $index, $subfield ) = $matches;
4646
$map[ $template ] = $subfield;
@@ -63,8 +63,8 @@
6363
if ( $rows ) {
6464
foreach ( $rows as $row ) {
6565
$choice = array(
66-
'value' => apply_filters( 'gppa_acfrm_value', rgar( $row, $map['value'] ), $row, $map['value'] ),
67-
'text' => apply_filters( 'gppa_acfrm_label', rgar( $row, $map['label'] ), $row, $map['label'] ),
66+
'value' => apply_filters( 'gppa_acfrm_value', rgar( $row, $map['value'] ), $row, $map['value'] ),
67+
'text' => apply_filters( 'gppa_acfrm_label', rgar( $row, $map['label'] ), $row, $map['label'] ),
6868
);
6969
if ( isset( $map['inventory_limit'] ) ) {
7070
$choice['inventory_limit'] = apply_filters( 'gppa_acfrm_inventory_limit', rgar( $row, $map['inventory_limit'] ), $row, $map['inventory_limit'] );

gp-read-only/gpro-input-specific-read-only-for-address-fields.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* https://gravitywiz.com/documentation/gravity-forms-read-only/
55
*
66
* Instructions
7-
*
7+
*
88
* 1. Enable the "Read-only" setting in your Address field's field settings.
99
*
1010
* 2. Install this snippet.
@@ -14,7 +14,7 @@
1414
*/
1515
// Update "123" to your form ID and "4" to your Address field ID.
1616
add_filter( 'gform_field_input_123_4', function( $input, $field, $value, $lead_id, $form_id ) {
17-
// Update these numbers to the input indexes that should NOT be read-only.
17+
// Update these numbers to the input indexes that should NOT be read-only.
1818
$input_ids = array( 1, 2, 3, 5 );
1919
foreach ( $input_ids as $input_id ) {
2020
$input = str_replace( "readonly='readonly' type='text' name='input_{$field->id}.{$input_id}'", "type='text' name='input_{$field->id}.{$input_id}'", $input );

gravity-forms/gw-include-option-label-and-value-in-order-summary.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* to include both the label and value wherever the order summary is displayed (e.g. Entry Detail, {all_fields}, etc).
88
*/
99
add_filter( 'gform_product_info', function( $product_info, $form ) {
10-
foreach( $product_info['products'] as &$product ) {
11-
foreach( $product['options'] as &$option ) {
10+
foreach ( $product_info['products'] as &$product ) {
11+
foreach ( $product['options'] as &$option ) {
1212
$field = GFAPI::get_field( $form, $option['id'] );
1313
foreach ( $field->choices as $choice ) {
1414
if ( $choice['text'] !== $choice['value'] && in_array( $option['option_name'], array( $choice['text'], $choice['value'] ) ) ) {

gravity-forms/gw-limit-multi-selects.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,7 @@ public function validate( $result, $value, $form, $field ) {
209209
if ( $count < $min ) {
210210
$result['is_valid'] = false;
211211
$result['message'] = __( "Please select {$min} or more options." );
212-
}
213-
elseif ( $count > $max ) {
212+
} elseif ( $count > $max ) {
214213
$result['is_valid'] = false;
215214
$result['message'] = __( "Please select less than {$max} options." );
216215
}

gravity-forms/gw-update-posts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function update_post_by_entry( $entry, $form ) {
102102
( ! is_array( $this->_args['post_date'] ) && ! empty( $this->_args['post_date'] ) ) ||
103103
rgars( $this->_args, 'post_date/date' )
104104
) {
105-
$new_date_time = $this->get_post_date( $entry, $form );
105+
$new_date_time = $this->get_post_date( $entry, $form );
106106
if ( $new_date_time ) {
107107
$post->post_date = $new_date_time;
108108
$post->post_date_gmt = get_gmt_from_date( $new_date_time );

gs-product-configurator/gspc-include-wc-quantity-in-total-field.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function __construct( $args = array() ) {
2020

2121
// Set default arguments, parse against the provided arguments, and store for use throughout the class.
2222
$this->_args = wp_parse_args( $args, array(
23-
'form_id' => false,
23+
'form_id' => false,
2424
) );
2525

2626
add_action( 'init', array( $this, 'init' ) );
@@ -90,7 +90,7 @@ public function add_init_script( $form ) {
9090
}
9191

9292
$args = array(
93-
'formId' => $this->_args['form_id'],
93+
'formId' => $this->_args['form_id'],
9494
);
9595

9696
$script = 'new ' . __CLASS__ . '( ' . json_encode( $args ) . ' );';
@@ -126,6 +126,6 @@ public function is_applicable_form( $form ) {
126126

127127
// Configuration
128128
new GSPC_Include_WC_Product_Quantity_In_Total( array(
129-
// Update "123" to your form ID
130-
'form_id' => 123,
129+
// Update "123" to your form ID
130+
'form_id' => 123,
131131
) );

gs-product-configurator/gspc-remove-addons-from-order-email.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class GSPC_Remove_Addons_in_Order_Email {
1010
public function __construct( $args = array() ) {
1111

1212
$this->_args = wp_parse_args( $args, array(
13-
'form_id' => false,
13+
'form_id' => false,
1414
) );
1515

1616
// do version check in the init to make sure if GF is going to be loaded, it is already loaded

0 commit comments

Comments
 (0)