Skip to content

Commit 16a94ed

Browse files
committed
Formatting: PHPCS automatic fixes.
1 parent 9ac00d0 commit 16a94ed

File tree

5 files changed

+23
-23
lines changed

5 files changed

+23
-23
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
}
2525

2626
$form_id = rgars( $entries, '0/form_id' );
27-
$sub_length_field_id = rgar( $form_field_map, $form_id );
27+
$sub_length_field_id = rgar( $form_field_map, $form_id );
2828
if ( ! $sub_length_field_id ) {
2929
continue;
3030
}
31-
31+
3232
$sub_length = rgars( $entries, "0/{$sub_length_field_id}" );
3333

3434
// phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date

gp-nested-forms/gpnf-always-include-child-entries-from-session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
$session = new GPNF_Session( $form['id'] );
1313
$_entries = $session->get( 'nested_entries' );
1414
if ( ! empty( $_entries[ $field->id ] ) ) {
15-
$entry_ids = array_merge( $entry_ids, $_entries[ $field->id ]);
15+
$entry_ids = array_merge( $entry_ids, $_entries[ $field->id ] );
1616
}
1717

1818
return $entry_ids;

gp-nested-forms/gpnf-gflow-form-connector-duplicate-child-entries.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,41 +9,41 @@
99
add_action( 'gravityflowformconnector_post_new_entry', function( $entry_id, $entry, $form, $step_new_entry ) {
1010

1111
if ( ! class_exists( 'GPNF_Entry' ) || ! function_exists( 'gp_nested_forms' ) ) {
12-
return;
13-
}
12+
return;
13+
}
1414

1515
$new_entry = GFAPI::get_entry( $entry_id );
1616

17-
// Loop through each field in the form
18-
foreach ( $form['fields'] as $field ) {
17+
// Loop through each field in the form
18+
foreach ( $form['fields'] as $field ) {
1919

2020
// Check if it's a Nested Form field
21-
if ( $field->get_input_type() !== 'form' ) {
21+
if ( $field->get_input_type() !== 'form' ) {
2222
continue;
23-
}
23+
}
2424

25-
$child_entries = ( new GPNF_Entry( $new_entry ) )->get_child_entries( $field->id );
25+
$child_entries = ( new GPNF_Entry( $new_entry ) )->get_child_entries( $field->id );
2626
if ( empty( $child_entries ) ) {
2727
continue;
2828
}
2929

30-
$duplicated_child_entries = array();
30+
$duplicated_child_entries = array();
3131

32-
// Duplicate the child entries and associate them with this new entry
33-
foreach ( $child_entries as $child_entry ) {
32+
// Duplicate the child entries and associate them with this new entry
33+
foreach ( $child_entries as $child_entry ) {
3434

3535
$child_entry[ GPNF_Entry::ENTRY_PARENT_KEY ] = $new_entry['id'];
3636
$child_entry[ GPNF_Entry::ENTRY_PARENT_FORM_KEY ] = $new_entry['form_id'];
3737
$child_entry[ GPNF_Entry::ENTRY_NESTED_FORM_FIELD_KEY ] = $field->id;
3838
// @todo Add support for fetching Nested Form ID from target Nested Form field.
3939
//$child_entry['form_id'] = $field->gpnfForm;
4040

41-
$duplicated_child_entry = GFAPI::add_entry( $child_entry );
42-
$duplicated_child_entries[] = $duplicated_child_entry;
43-
}
41+
$duplicated_child_entry = GFAPI::add_entry( $child_entry );
42+
$duplicated_child_entries[] = $duplicated_child_entry;
43+
}
4444

45-
// Update Nested Form Field value on parent form to use the newly duplicated child entries.
46-
GFAPI::update_entry_field( $new_entry['id'], $field->id, implode( ',', $duplicated_child_entries ) );
45+
// Update Nested Form Field value on parent form to use the newly duplicated child entries.
46+
GFAPI::update_entry_field( $new_entry['id'], $field->id, implode( ',', $duplicated_child_entries ) );
4747

48-
}
48+
}
4949
}, 10, 4 );

gp-nested-forms/gpnf-hide-edit-button.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
<tr data-bind="attr: { 'data-entryid': id }">
4444
<?php foreach ( $nested_fields as $nested_field ) : ?>
4545
<td class="gpnf-field"
46-
data-bind="html: f<?php echo $nested_field['id']; ?>.label, attr: { 'data-value': f<?php echo $nested_field['id']; ?>.label }"
47-
data-heading="<?php echo GFCommon::get_label( $nested_field ); ?>"
46+
data-bind="html: f<?php echo $nested_field['id']; ?>.label, attr: { 'data-value': f<?php echo $nested_field['id']; ?>.label }"
47+
data-heading="<?php echo GFCommon::get_label( $nested_field ); ?>"
4848
>&nbsp;</td>
4949
<?php endforeach; ?>
5050
<td class="gpnf-row-actions" style="display: none;" data-bind="visible: true">

gs-product-configurator/gspc-display-discounts-on-entry.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
$order = $order_item->get_order();
1919

2020
if ( $order_item->get_subtotal() !== $order_item->get_total() ) {
21-
$product_info['products'][ \GS_Product_Configurator\WC_Product_Form_Display::BASE_PRICE_PRODUCT_FIELD_ID . '.discount' ] = [
21+
$product_info['products'][ \GS_Product_Configurator\WC_Product_Form_Display::BASE_PRICE_PRODUCT_FIELD_ID . '.discount' ] = array(
2222
'name' => __( 'Discount' ),
2323
'price' => wc_price( wc_format_decimal( ( $order_item->get_subtotal() - $order_item->get_total() ) * -1, '' ), array( 'currency' => $order->get_currency() ) ),
2424
'quantity' => 1,
25-
];
25+
);
2626
}
2727

2828
return $product_info;

0 commit comments

Comments
 (0)