Skip to content

Enforce empty line between end curl and var assignment#2624

Merged
Crabcyborg merged 3 commits into
masterfrom
enforce_empty_line_between_end_curl_and_var_assignment
Dec 3, 2025
Merged

Enforce empty line between end curl and var assignment#2624
Crabcyborg merged 3 commits into
masterfrom
enforce_empty_line_between_end_curl_and_var_assignment

Conversation

@Crabcyborg
Copy link
Copy Markdown
Contributor

No description provided.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 3, 2025

Warning

Rate limit exceeded

@Crabcyborg has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 5 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between e46662e and b6cf535.

⛔ Files ignored due to path filters (1)
  • .github/workflows/phpcs.yml is excluded by !**/*.yml
📒 Files selected for processing (4)
  • .gitattributes (1 hunks)
  • bin/zip-plugin.sh (1 hunks)
  • phpstan.neon (1 hunks)
  • tests/phpunit/misc/test_FrmDirectFileAccess.php (1 hunks)

Walkthrough

This PR contains widespread formatting improvements with blank line insertions across 60+ files alongside targeted functional enhancements. Key changes include style export filtering in XML generation, email fallback type normalization, array meta value cleanup, shortcode processing in validation, and UI data attribute population. A new PHP_CodeSniffer sniff enforces blank lines after closing braces.

Changes

Cohort / File(s) Summary
Formatting & Whitespace
classes/controllers/FrmAppController.php, classes/controllers/FrmEmailStylesController.php, classes/controllers/FrmEntriesController.php, classes/controllers/FrmFormActionsController.php, classes/controllers/FrmFormsController.php, classes/helpers/FrmApiHelper.php, classes/helpers/FrmAppHelper.php, classes/helpers/FrmCSVExportHelper.php, classes/helpers/FrmEntriesHelper.php, classes/helpers/FrmEntriesListHelper.php, classes/helpers/FrmFieldsHelper.php, classes/helpers/FrmFormsListHelper.php, classes/helpers/FrmListHelper.php, classes/helpers/FrmStylesHelper.php, classes/helpers/FrmStylesPreviewHelper.php, classes/helpers/FrmSubmitHelper.php, classes/helpers/FrmXMLHelper.php, classes/models/FrmDb.php, classes/models/FrmEmailSummary.php, classes/models/FrmEntry.php, classes/models/FrmEntryFormatter.php, classes/models/FrmField.php, classes/models/FrmFieldFormHtml.php, classes/models/FrmForm.php, classes/models/FrmFormAction.php, classes/models/FrmFormApi.php, classes/models/FrmFormState.php, classes/models/FrmInbox.php, classes/models/FrmReviews.php, classes/models/FrmSolution.php, classes/models/fields/FrmFieldCaptcha.php, classes/models/fields/FrmFieldTextarea.php, classes/models/fields/FrmFieldUrl.php, classes/views/frm-fields/front-end/radio-field.php, classes/views/frm-form-actions/default_actions.php, classes/views/frm-settings/general.php, classes/views/frm-settings/payments.php, classes/views/styles/_style-options.php, stripe/controllers/FrmStrpLiteActionsController.php, stripe/helpers/FrmStrpLiteConnectHelper.php, stripe/helpers/FrmTransLiteAppHelper.php, stripe/models/FrmStrpLiteAuth.php, tests/phpunit/entries/test_FrmShowEntryShortcode.php
Added blank lines for improved code readability; no functional or control-flow changes.
XML Export & Import
classes/controllers/FrmXMLController.php, classes/helpers/FrmXMLHelper.php, tests/phpunit/base/FrmUnitTest.php
Style export filtering in generate_xml computes style_ids from forms and filters by those IDs; time limit adjustment in csv; blank line additions in test generate_xml.
Form Helpers & License
classes/controllers/FrmAddonsController.php, classes/helpers/FrmFormsHelper.php
FrmAddonsController narrows installed_addons to 'formidable_pro' entry; FrmFormsHelper updates plan_is_allowed loop logic, appends sanitize_url=1 parameter in maybe_add_sanitize_url_attr.
Email & Data Normalization
classes/models/FrmEmail.php, classes/models/FrmEntryMeta.php
Email fallback converts header and recipient to strings before mail() call; entry meta filters array values to remove empty entries prior to serialization.
Validation & Guest Info
classes/models/FrmEntryValidate.php
options_are_dynamic_based_on_hook applies shortcode to option values; is_akismet_guest_info_value retrieves form_id and name fields to compose guest author from first/last names.
Field Type Logic
classes/models/fields/FrmFieldEmail.php, classes/models/fields/FrmFieldGdpr.php, classes/models/fields/FrmFieldType.php
Minor formatting adjustments with no functional changes across email validation, GDPR options, and field type lookups.
View Templates — Data & UI
classes/views/frm-fields/front-end/gdpr/gdpr-field.php, classes/views/frm-forms/landing-page-preview-option.php, classes/views/frm-forms/mb_insert_fields.php, classes/views/frm-forms/spam-settings/antispam.php, classes/views/shared/errors.php, classes/views/shared/mb_adv_info.php, classes/views/shared/upgrade_overlay.php
landing-page-preview-option constructs $data and data-prefixed parameters for anchor attributes; mb_insert_fields adds data_attrs for contextual shortcodes; antispam initializes $tooltip before pro check; errors applies 'frm_message_list' filter; mb_adv_info calculates $include_x prefix flag.
Code Quality Enforcement
phpcs-sniffs/Formidable/Sniffs/WhiteSpace/BlankLineAfterClosingBraceSniff.php
New PHP_CodeSniffer sniff enforces blank lines after closing braces before variable assignments via register() and process() methods with automatic fix support.
Payment Integration
stripe/helpers/FrmStrpLiteConnectApiAdapter.php, stripe/helpers/FrmStrpLiteLinkRedirectHelper.php, square/helpers/FrmSquareLiteConnectHelper.php
Stripe adapter assigns $customer_id for non-admin path; link redirect adds formatting; Square helper formatting adjustment.
Unit Tests
tests/phpunit/base/FrmUnitTest.php
create_files calls FrmProFileImport::attach_existing_image for existing file paths and records image IDs.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Areas requiring extra attention:

  • FrmXMLController::generate_xml — Style filtering logic and where-clause updates for conditional export; verify filtering correctly associates styles with selected forms.
  • FrmFormsHelper::plan_is_allowed — Loop termination logic change; confirm loop iteration and return value behavior are correct.
  • FrmEntryValidate::is_akismet_guest_info_value — New form_id/name field retrieval for guest author composition; ensure field lookups and name composition logic handle edge cases (missing fields, null values).
  • View templates (landing-page-preview-option, mb_insert_fields, antispam, errors, mb_adv_info) — Multiple data attribute preparations and filter applications; verify data flows correctly to output and no XSS/sanitization regressions.
  • BlankLineAfterClosingBraceSniff — New sniff logic for token detection and fix application; test edge cases (missing tokens, blank lines, non-assignment scenarios).
  • FrmEmail::send_single — String conversion for header and recipient in fallback path; verify mail() call compatibility across PHP versions.
  • FrmStrpLiteConnectApiAdapter::cancel_subscription — $customer_id assignment for non-admin branch; confirm it's properly used downstream.
  • Heterogeneity — 60+ files touched with varied change types across multiple subsystems (export, validation, views, integrations) increases context-switching burden.

Possibly related PRs

  • Run some rector changes #2509 — Both PRs modify FrmAddonsController and addon/license handling logic; #2509 modernizes array key access while this PR narrows addon selection.
  • Show/Hide some shortcodes contextually #2052 — Both PRs update contextual shortcode handling via data-contextual-shortcodes attribute in mb_insert_fields.php and related shortcode UI improvements.

Suggested reviewers

  • lauramekaj1
  • shervElmi
  • truongwp

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess whether a description exists that relates to the changeset. Add a pull request description explaining the purpose, motivation, and scope of enforcing blank lines between closing braces and variable assignments.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Enforce empty line between end curl and var assignment' is specific and directly reflects the main change: a new PHP CodeSniffer sniff enforces blank lines after closing braces before variable assignments.
Docstring Coverage ✅ Passed Docstring coverage is 96.67% which is sufficient. The required threshold is 80.00%.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
classes/helpers/FrmAppHelper.php (1)

3138-3145: Regex in get_formatted_time uses an invalid quantifier

preg_match( '/^\d{1-2}\/\d{1-2}\/\d{4}$/', $date ) is not a valid PCRE quantifier ({m,n} expects digits with a comma), so this pattern will never work as intended and may emit warnings. It looks like you meant “1 or 2 digits”.

Consider updating to:

-		if ( preg_match( '/^\d{1-2}\/\d{1-2}\/\d{4}$/', $date ) && self::pro_is_installed() ) {
+		if ( preg_match( '/^\d{1,2}\/\d{1,2}\/\d{4}$/', $date ) && self::pro_is_installed() ) {

This is an existing issue, but it might be worth fixing while you’re in this file.

🧹 Nitpick comments (5)
classes/views/frm-forms/landing-page-preview-option.php (1)

6-16: Robust data-attribute building for upgrade link; consider light type guard.

Generating data-* attributes via FrmAppHelper::get_landing_page_upgrade_data_params() and array_to_html_params() is a clean way to expose metadata to JS, and centralizes escaping. To be extra defensive against unexpected filter output, you could coerce $data to an array before array_keys, e.g.:

$data = (array) FrmAppHelper::get_landing_page_upgrade_data_params( 'landing-preview' );

This avoids warnings if a filter ever returns null or a scalar.

classes/views/frm-forms/mb_insert_fields.php (1)

6-12: Good pattern for exposing contextual shortcode metadata to JS.

Using FrmAppHelper::maybe_json_encode( FrmShortcodeHelper::get_contextual_codes() ) and array_to_html_params() is a clean, centralized way to push contextual data onto the container element. If get_contextual_codes() can ever return an empty array, you could optionally skip the attribute when the encoded string is empty, but this is not required.

classes/models/FrmEmail.php (1)

559-585: Correct normalization for mail() fallback; consider preserving original recipient for hooks.

Normalizing $header to a CRLF-joined string and $recipient to a comma-separated string before calling mail() fixes incorrect parameter types in the fallback path and aligns with PHP’s mail() signature. One small consideration: do_action( 'frm_notification', $recipient, ... ) will now receive the normalized string even when send_single() was originally passed an array. If any consumer relies on the pre-normalized type in this rare failure path, you could preserve it via an $original_recipient variable:

$original_recipient = $recipient;
// ...
if ( ! $sent ) {
    if ( is_array( $header ) ) {
        $header = implode( "\r\n", $header );
    }
    $recipient = implode( ',', (array) $recipient );
    $sent      = mail( $recipient, $subject, $this->message, $header );
}

do_action( 'frm_notification', $original_recipient, $subject, $this->message );

Not mandatory, but slightly safer for backwards compatibility.

classes/controllers/FrmXMLController.php (1)

519-543: Styles export now constrained to styles actually used by selected forms.

The styles branch in generate_xml() now:

  • Collects each selected form via FrmForm::getOne( $form_id ).
  • Resolves the effective style ID per form, mapping custom_style === 1 to the default style ID.
  • Builds $style_ids and, when non-empty, constrains the frm_styles query with where['ID'] = $style_ids.

This is a solid improvement over exporting all style posts. Two minor hardening suggestions:

  • Guard against missing/invalid forms to avoid notices if an ID slips through:
foreach ( (array) $form_ids as $form_id ) {
    $form_data = FrmForm::getOne( $form_id );
    if ( ! $form_data || empty( $form_data->options ) ) {
        continue;
    }
    // existing custom_style logic...
}
  • Optionally array_unique( $style_ids ) before using it in $where to avoid redundant IDs.

Both are small robustness tweaks; existing logic is otherwise sound.

classes/models/FrmEntryValidate.php (1)

841-878: Guest author name concatenation works, with a couple of robustness nits

The new branch for comment_author correctly tries to build a full name from separate text fields labelled “Name” and “Last”, and using a cached get_name_text_fields() call keeps it efficient.

Two small refinements you might consider (not blockers):

  • Tie the concatenation more tightly to the actual field being examined, e.g. only append the “Last” value when the current $field_id matches the “Name” field’s id, to avoid ever using an unrelated $value as the first name purely because a Name/Last pair exists on the form.
  • Short‑circuit when $form_id is falsy before calling get_name_text_fields() to avoid an unnecessary DB query in edge cases where form_id isn’t present in the POST.

Functionally this is an improvement over the previous behavior; these would just make the heuristic a bit more precise.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7ad66f3 and e46662e.

⛔ Files ignored due to path filters (2)
  • phpcs-sniffs/Formidable/ruleset.xml is excluded by !**/*.xml
  • phpcs.xml is excluded by !**/*.xml
📒 Files selected for processing (64)
  • classes/controllers/FrmAddonsController.php (5 hunks)
  • classes/controllers/FrmAppController.php (2 hunks)
  • classes/controllers/FrmEmailStylesController.php (1 hunks)
  • classes/controllers/FrmEntriesController.php (1 hunks)
  • classes/controllers/FrmFormActionsController.php (1 hunks)
  • classes/controllers/FrmFormsController.php (3 hunks)
  • classes/controllers/FrmXMLController.php (5 hunks)
  • classes/helpers/FrmApiHelper.php (2 hunks)
  • classes/helpers/FrmAppHelper.php (6 hunks)
  • classes/helpers/FrmCSVExportHelper.php (3 hunks)
  • classes/helpers/FrmEntriesHelper.php (1 hunks)
  • classes/helpers/FrmEntriesListHelper.php (2 hunks)
  • classes/helpers/FrmFieldsHelper.php (4 hunks)
  • classes/helpers/FrmFormsHelper.php (4 hunks)
  • classes/helpers/FrmFormsListHelper.php (1 hunks)
  • classes/helpers/FrmListHelper.php (3 hunks)
  • classes/helpers/FrmStylesHelper.php (5 hunks)
  • classes/helpers/FrmStylesPreviewHelper.php (1 hunks)
  • classes/helpers/FrmSubmitHelper.php (1 hunks)
  • classes/helpers/FrmXMLHelper.php (2 hunks)
  • classes/models/FrmDb.php (3 hunks)
  • classes/models/FrmEmail.php (1 hunks)
  • classes/models/FrmEmailSummary.php (1 hunks)
  • classes/models/FrmEntry.php (2 hunks)
  • classes/models/FrmEntryFormatter.php (1 hunks)
  • classes/models/FrmEntryMeta.php (3 hunks)
  • classes/models/FrmEntryValidate.php (5 hunks)
  • classes/models/FrmField.php (2 hunks)
  • classes/models/FrmFieldFormHtml.php (1 hunks)
  • classes/models/FrmForm.php (2 hunks)
  • classes/models/FrmFormAction.php (1 hunks)
  • classes/models/FrmFormApi.php (2 hunks)
  • classes/models/FrmFormState.php (3 hunks)
  • classes/models/FrmInbox.php (2 hunks)
  • classes/models/FrmReviews.php (1 hunks)
  • classes/models/FrmSolution.php (1 hunks)
  • classes/models/fields/FrmFieldCaptcha.php (2 hunks)
  • classes/models/fields/FrmFieldEmail.php (1 hunks)
  • classes/models/fields/FrmFieldGdpr.php (1 hunks)
  • classes/models/fields/FrmFieldTextarea.php (1 hunks)
  • classes/models/fields/FrmFieldType.php (2 hunks)
  • classes/models/fields/FrmFieldUrl.php (1 hunks)
  • classes/views/frm-fields/front-end/gdpr/gdpr-field.php (1 hunks)
  • classes/views/frm-fields/front-end/radio-field.php (1 hunks)
  • classes/views/frm-form-actions/default_actions.php (1 hunks)
  • classes/views/frm-forms/landing-page-preview-option.php (1 hunks)
  • classes/views/frm-forms/mb_insert_fields.php (1 hunks)
  • classes/views/frm-forms/spam-settings/antispam.php (1 hunks)
  • classes/views/frm-settings/general.php (2 hunks)
  • classes/views/frm-settings/payments.php (1 hunks)
  • classes/views/shared/errors.php (1 hunks)
  • classes/views/shared/mb_adv_info.php (1 hunks)
  • classes/views/shared/upgrade_overlay.php (1 hunks)
  • classes/views/styles/_style-options.php (1 hunks)
  • phpcs-sniffs/Formidable/Sniffs/WhiteSpace/BlankLineAfterClosingBraceSniff.php (1 hunks)
  • square/helpers/FrmSquareLiteConnectHelper.php (1 hunks)
  • stripe/controllers/FrmStrpLiteActionsController.php (1 hunks)
  • stripe/helpers/FrmStrpLiteConnectApiAdapter.php (1 hunks)
  • stripe/helpers/FrmStrpLiteConnectHelper.php (2 hunks)
  • stripe/helpers/FrmStrpLiteLinkRedirectHelper.php (1 hunks)
  • stripe/helpers/FrmTransLiteAppHelper.php (2 hunks)
  • stripe/models/FrmStrpLiteAuth.php (2 hunks)
  • tests/phpunit/base/FrmUnitTest.php (2 hunks)
  • tests/phpunit/entries/test_FrmShowEntryShortcode.php (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
classes/models/FrmEntryMeta.php (1)
classes/models/FrmDb.php (2)
  • FrmDb (6-852)
  • prepend_and_or_where (637-657)
🪛 GitHub Check: PHPStan
phpcs-sniffs/Formidable/Sniffs/WhiteSpace/BlankLineAfterClosingBraceSniff.php

[failure] 137-137:
Access to property $fixer on an unknown class PHP_CodeSniffer\Files\File.


[failure] 130-130:
Call to method addFixableError() on an unknown class PHP_CodeSniffer\Files\File.


[failure] 124-124:
Constant T_CLOSE_CURLY_BRACKET not found.


[failure] 92-92:
Call to method findNext() on an unknown class PHP_CodeSniffer\Files\File.


[failure] 62-62:
Constant T_EQUAL not found.


[failure] 55-55:
Call to method findNext() on an unknown class PHP_CodeSniffer\Files\File.


[failure] 51-51:
Call to method getTokens() on an unknown class PHP_CodeSniffer\Files\File.


[failure] 50-50:
Parameter $phpcsFile of method Formidable\Sniffs\WhiteSpace\BlankLineAfterClosingBraceSniff::process() has invalid type PHP_CodeSniffer\Files\File.


[failure] 50-50:
Parameter $phpcsFile of method Formidable\Sniffs\WhiteSpace\BlankLineAfterClosingBraceSniff::process() has invalid type PHP_CodeSniffer\Files\File.


[failure] 31-31:
Class Formidable\Sniffs\WhiteSpace\BlankLineAfterClosingBraceSniff implements unknown interface PHP_CodeSniffer\Sniffs\Sniff.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: PHP 8 tests in WP trunk
  • GitHub Check: PHP 7.4 tests in WP trunk
  • GitHub Check: Cypress
  • GitHub Check: Cypress
  • GitHub Check: PHP 8 tests in WP trunk
  • GitHub Check: PHP 7.4 tests in WP trunk
🔇 Additional comments (87)
classes/views/styles/_style-options.php (1)

5-5: LGTM!

The blank line between the guard clause and variable assignments improves code organization and aligns perfectly with the PR objective to enforce empty lines after closing braces.

classes/models/fields/FrmFieldUrl.php (1)

103-103: Formatting aligns with PR objective.

The blank line inserted after the foreach loop closing brace and before the variable assignment correctly enforces the formatting rule stated in the PR objective. The change maintains code readability and follows the PHP_CodeSniffer standard being introduced.

classes/models/FrmSolution.php (1)

645-665: Formatting change aligns with new PHP_CodeSniffer sniff.

The blank line added after the foreach loop closing brace (line 658) and before the $width variable assignment (line 659) correctly enforces the PR's style rule. No functional changes.

classes/models/fields/FrmFieldCaptcha.php (1)

110-117: Formatting changes align with PR objectives.

The blank lines inserted after closing braces (lines 116 and 351) appropriately enforce the coding standard of maintaining empty lines between closing braces and variable assignments. Both changes follow the pattern consistently and improve code readability without affecting functionality.

Also applies to: 346-356

classes/models/FrmFieldFormHtml.php (1)

538-543: LGTM! Formatting improvement aligns with PR objectives.

The blank line insertion between the closing brace and the subsequent variable assignment (line 541) follows the PR's stated intent to enforce empty lines after closing braces. This improves code readability without affecting logic or functionality.

classes/views/frm-settings/payments.php (1)

27-27: LGTM!

The blank line separation between the closing brace and the variable assignment improves code readability and aligns with the PHP_CodeSniffer sniff enforcement for this PR. No functional changes.

classes/models/fields/FrmFieldTextarea.php (1)

61-68: Formatting improvement aligns with PR objective.

The blank line added at line 65 between the closing brace and the $style variable assignment follows the PR's enforcement of blank lines after closing braces. This improves readability with no functional impact.

classes/models/FrmForm.php (2)

709-713: Formatting change approved: blank line added after closing brace.

The empty line added after the null-check conditional (line 711) and before the variable assignment (line 713) aligns with the PR objective and improves code readability by separating control flow from subsequent assignments.


1173-1179: Formatting change approved: blank line added after if-else block.

The empty line added after the if-else block (line 1177) and before the variable assignment (line 1179) consistently applies the same formatting standard, enhancing visual separation between conditional logic and variable initialization.

classes/views/shared/upgrade_overlay.php (1)

34-42: Blank line insertion is fine and matches stated style goal

The added blank line between the if/else block and the following $message = sprintf(...) keeps behavior unchanged and aligns with the PR’s formatting rule.

classes/helpers/FrmEntriesListHelper.php (2)

215-221: Blank line correctly enforced after closing brace.

The added blank line between the if block and the $has_form variable assignment aligns perfectly with the PR's style enforcement objective.


382-391: Blank line correctly enforced after closing brace.

The added blank line between the if-else block and the $r .= '</td>'; statement maintains consistent code style per the PR's formatting improvements.

classes/models/fields/FrmFieldGdpr.php (1)

102-108: Blank line after guard clause improves readability; no behavior change

The added empty line cleanly separates the early-return guard from the main body of show_primary_options, matching the new coding standard without affecting runtime behavior. Looks good as-is.

classes/views/frm-forms/spam-settings/antispam.php (1)

5-6: LGTM! Formatting improvement aligns with coding standards.

The added blank line correctly enforces spacing between the closing brace and variable assignment, consistent with the PR's objective to improve code readability.

classes/models/FrmFormAction.php (1)

680-682: Blank line separator added correctly.

The blank line between the control structure's closing brace and the variable assignment improves code readability and aligns with the PR's formatting enforcement objective.

classes/helpers/FrmSubmitHelper.php (1)

204-214: LGTM! Formatting improvement aligns with PR objective.

The empty line added after the if statement's closing brace improves readability by visually separating the conditional return from the subsequent variable assignment. This change is consistent with the PR's goal to enforce blank lines between closing braces and variable assignments.

classes/views/frm-fields/front-end/gdpr/gdpr-field.php (1)

11-11: LGTM! Formatting improvement aligns with PR objectives.

The blank line improves readability by visually separating the ABSPATH security check from the variable assignments that follow.

classes/models/fields/FrmFieldType.php (2)

1441-1442: LGTM! Formatting improvement aligns with coding standards.

The added blank line improves readability by visually separating the loop logic from the closing statement.


1669-1671: LGTM! Formatting improvement enhances code readability.

The added blank line properly separates the guard clause from the main method logic.

classes/views/shared/mb_adv_info.php (1)

243-243: LGTM! Blank line improves readability.

The blank line addition after the closing brace and before the variable assignment aligns with the PR objective and improves code organization.

classes/models/FrmFormApi.php (2)

249-267: LGTM!

The blank line insertion after the if block (line 253) aligns with the PR's formatting enforcement for spacing between closing braces and variable assignments.


407-424: LGTM!

The blank line insertion after the if block (line 411) is consistent with the formatting pattern being enforced in this PR.

classes/views/frm-fields/front-end/radio-field.php (1)

38-51: LGTM!

The blank line at line 49 properly separates the label rendering block from the $checked variable assignment, improving readability.

classes/helpers/FrmListHelper.php (3)

498-519: LGTM!

The blank line at line 513 properly separates the foreach loop from the subsequent string concatenation, consistent with the PR's formatting standard.


649-665: LGTM!

The blank line at line 660 adds appropriate spacing between the conditional block and the $html_total_pages assignment.


684-690: LGTM!

The blank line at line 688 properly separates the if block from the $output concatenation statement.

classes/helpers/FrmFormsListHelper.php (1)

443-453: LGTM!

The blank line at line 448 properly separates the null/empty check block from the subsequent kses sanitization call.

square/helpers/FrmSquareLiteConnectHelper.php (1)

565-573: LGTM!

The blank line at line 570 properly separates the early return conditional from the $test_mode variable assignment.

classes/views/frm-form-actions/default_actions.php (1)

140-154: LGTM!

The blank line at line 149 properly separates the pro installation check block from the $link assignment.

classes/models/FrmEmailSummary.php (1)

176-195: LGTM!

The blank line at line 191 properly separates the content validation block from the subsequent variable assignments for $subject and $headers.

classes/models/FrmEntry.php (2)

591-609: LGTM!

The blank line at line 605 properly separates the $where conditional assignment block from the database query call.


759-771: LGTM!

The blank line at line 766 properly separates the conditional block from the $count calculation.

classes/models/fields/FrmFieldEmail.php (1)

48-57: LGTM!

The blank line insertion after the early return block follows the new coding standard being enforced across the codebase.

classes/models/FrmEntryFormatter.php (1)

987-1000: LGTM!

The blank line insertion after the if block containing the <img> tag handling aligns with the coding standard enforcement.

classes/helpers/FrmEntriesHelper.php (1)

279-286: LGTM!

The blank line insertion after the separator-setting if block follows the new coding standard.

classes/models/FrmReviews.php (1)

109-120: LGTM!

The blank line insertion after the entry-rounding if/else block is consistent with the coding standard being enforced.

classes/controllers/FrmEntriesController.php (1)

296-305: LGTM!

The blank line insertion after the early return block aligns with the coding standard enforcement.

classes/helpers/FrmXMLHelper.php (2)

380-392: LGTM!

The blank line insertion after the foreach loop in get_form_fields follows the coding standard.


1120-1135: LGTM!

The blank line insertion after the early continue check in clear_forms_style_caches is consistent with the coding standard.

classes/controllers/FrmEmailStylesController.php (1)

203-214: LGTM!

The blank line insertion after the style-injection if block aligns with the coding standard enforcement.

classes/models/FrmDb.php (3)

97-117: LGTM!

The blank line insertion after the nested where parsing block follows the coding standard.


141-161: LGTM!

The blank line insertions within the LIKE array handling logic align with the coding standard enforcement.


270-281: LGTM!

The blank line insertion after the foreach loop in generate_cache_key is consistent with the coding standard.

classes/controllers/FrmFormActionsController.php (1)

575-580: LGTM! Formatting improvement enhances readability.

The blank line added between the array_merge block and the array_diff call improves code readability without affecting functionality. This aligns with the PR's objective to enforce consistent blank line usage.

classes/models/FrmField.php (2)

506-510: LGTM! Improves code organization.

The blank line added after the count check enhances readability by visually separating the validation logic from the subsequent variable assignments.


858-864: LGTM! Enhances visual clarity.

The blank line before the database call improves readability by clearly separating the conditional logic from the database operation.

classes/controllers/FrmAppController.php (2)

86-90: LGTM! Formatting enhancement.

The blank line added after the wp_enqueue_style call provides better visual separation before the filter application, improving code readability.


787-792: LGTM! Improves code structure.

The blank line added after the early return check clearly separates the validation logic from the subsequent variable assignment, enhancing readability.

classes/views/frm-settings/general.php (2)

2-6: LGTM! Consistent formatting.

The blank line after the ABSPATH check follows a consistent pattern and improves visual separation between the security check and the main content.


62-67: LGTM! Enhances code organization.

The blank line before the GDPR options wrapper variable definition improves readability by providing visual separation from the preceding conditional logic.

classes/helpers/FrmStylesPreviewHelper.php (1)

347-353: LGTM! Improves readability.

The blank line added after the early return guard clause provides better visual separation before the main logic begins, making the code easier to scan.

classes/helpers/FrmApiHelper.php (2)

21-25: LGTM! Enhances code structure.

The blank line after the early return provides better visual separation before the main conditional logic begins.


97-105: LGTM! Improves visual flow.

The blank line added after the comment and conditional block enhances readability by clearly separating the different logical sections of the method.

classes/models/FrmInbox.php (2)

188-200: LGTM! Formatting improvement.

The blank line before the filter application provides better visual separation at the end of the method, making the final filter hook more prominent.


409-415: LGTM! Enhances readability.

The blank line added after the early return check provides clear visual separation before the main logic begins.

stripe/helpers/FrmTransLiteAppHelper.php (2)

204-210: LGTM! Improves code organization.

The blank line added after the form object assignment provides better visual separation before the filter application.


584-590: LGTM! Enhances readability.

The blank line before retrieving the currencies array improves visual separation between the select attributes configuration and the data retrieval logic.

classes/helpers/FrmStylesHelper.php (1)

157-182: Whitespace-only style adjustments look good

The added blank lines between closing braces and subsequent assignments/returns are purely formatting and align with the new coding standard; no functional impact.

Also applies to: 418-441, 479-500, 714-745, 1114-1124

classes/helpers/FrmAppHelper.php (1)

823-856: Formatting-only updates align with new sniff

All touched regions here (request helpers, icon rendering, textarea escaping, human_time_diff, and form-data formatting) only add or move blank lines / comments; behavior, return values, and hooks remain unchanged.

Also applies to: 1350-1388, 2520-2533, 3196-3246, 3707-3728

classes/helpers/FrmCSVExportHelper.php (1)

349-371: CSV helper diffs are purely cosmetic

The only changes here are extra blank lines before filter calls/assignments in field_headings, print_csv_row, and escape_csv. CSV structure and escaping semantics are unchanged.

Also applies to: 773-813, 871-879

classes/controllers/FrmAddonsController.php (1)

511-522: Primary license lookup correctly restricted to Formidable Pro

get_primary_license_info() now reassigns $installed_addons to only the 'formidable_pro' entry before passing it into fill_update_addon_info(). This keeps the “primary” license checks (eg, in is_license_expired()) focused on the Pro license instead of any other installed add‑ons, which should avoid mixed/incorrect error states. The surrounding hunks are whitespace-only.

Also applies to: 850-857, 866-878, 1273-1293

classes/models/FrmEntryMeta.php (2)

55-81: update_entry_meta now normalizes array values consistently with add_entry_meta

The new block:

if ( is_array( $values['meta_value'] ) ) {
	$values['meta_value'] = array_filter( $values['meta_value'], 'FrmAppHelper::is_not_empty_value' );
}
$meta_value = maybe_serialize( $values['meta_value'] );

ensures that, on update, array meta values are stripped of strictly empty entries before serialization, just like add_entry_meta() already does. This keeps create vs. update behavior consistent and avoids persisting empty slots in meta arrays, while preserving legitimate falsy values (e.g., 0, '0').

Looks good and low risk.


466-487: Whitespace-only changes in query helpers

The tweaks in should_join_fields_table() and search_entry_metas() are just added blank lines to satisfy the new style rule; the SQL generation and behavior are unchanged.

Also applies to: 602-639

classes/controllers/FrmFormsController.php (1)

100-106: Whitespace-only formatting; behavior unchanged.

The added blank lines in list_form(), should_insert_form_popup(), and get_shortcode_opts() are purely stylistic and do not alter logic or side effects.

Also applies to: 1096-1103, 1117-1139

classes/models/FrmFormState.php (1)

133-153: Formatting-only changes around state encryption; no functional impact.

The added blank lines in get_state_from_request(), render_state_field(), and get_state_string() do not change control flow or behavior.

Also applies to: 158-168, 173-183

classes/helpers/FrmFieldsHelper.php (1)

606-615: Formatting-only tweaks; logic remains the same.

The added blank lines in run_wpautop(), trigger_shortcode_atts(), and switch_ids_except_strings() are purely stylistic and do not affect how values are transformed or IDs are replaced.

Also applies to: 1121-1133, 1846-1857

classes/views/shared/errors.php (1)

16-42: New frm_message_list filter cleanly extends message rendering.

Passing $show_messages through apply_filters( 'frm_message_list', $show_messages ) before the existing is_array/count guard adds a useful extension point while keeping safety: non-array returns will simply result in no list being rendered, and each message is still run through FrmAppHelper::kses() with a constrained tag set. This is a straightforward, low-risk way to let add‑ons adjust or aggregate messages.

classes/controllers/FrmXMLController.php (2)

110-120: Whitespace-only adjustments; control flow unaffected.

The added blank lines in install_template(), get_posted_form(), and get_file_name() are cosmetic and do not alter error handling, JSON decoding, or filename generation logic.

Also applies to: 150-158, 641-648


682-700: Adding set_time_limit(0) before CSV export reduces timeout risk.

Calling set_time_limit( 0 ) (when available) ahead of the CSV export and then bumping memory via wp_raise_memory_limit() is appropriate for potentially large exports and is guarded with function_exists() to avoid fatal errors where the function is disabled. This should make long-running exports more reliable without altering query semantics.

classes/helpers/FrmFormsHelper.php (4)

137-137: LGTM - Formatting improvement

The blank line addition improves readability by visually separating the conditional block from the subsequent assignment.


570-570: LGTM - Formatting improvement

The blank line appropriately separates the security filtering logic from the subsequent processing.


678-684: Verify the loop logic is correct

The assignment $included = $plan === $plan_required now executes on every iteration after the break check. This means:

  • If $included becomes true, the loop breaks on the next iteration (before reassigning)
  • The final value of $included will be correct

While this appears functionally equivalent to the previous implementation, please verify that this logic correctly handles all plan hierarchy scenarios, especially edge cases where the plan required comes after the license type in the array.


993-993: LGTM - Formatting improvement

The blank line improves readability by separating the conditional logic from the shortcode construction.

phpcs-sniffs/Formidable/Sniffs/WhiteSpace/BlankLineAfterClosingBraceSniff.php (1)

31-145: LGTM - Well-implemented sniff with good edge case handling

The sniff correctly:

  • Identifies variable assignments preceded by closing braces
  • Handles edge cases (blank lines, non-assignments, etc.)
  • Provides automatic fixing via addNewlineBefore

The static analysis warnings about unknown PHP_CodeSniffer classes are false positives and can be safely ignored, as PHP_CodeSniffer is a development dependency.

stripe/helpers/FrmStrpLiteConnectHelper.php (2)

470-470: LGTM - Formatting improvement

The blank line appropriately separates the mode normalization logic from the subsequent variable assignments.


662-662: LGTM - Formatting improvement

The blank line improves readability by separating the conditional check from the mode value retrieval.

stripe/controllers/FrmStrpLiteActionsController.php (1)

440-440: LGTM - Formatting improvement

The blank line enhances readability by separating the conditional suffix assignment from the script URL construction.

tests/phpunit/entries/test_FrmShowEntryShortcode.php (1)

832-832: LGTM - Formatting improvement

The blank line improves readability by separating the conditional class addition from the tag completion.

stripe/models/FrmStrpLiteAuth.php (2)

263-263: LGTM - Formatting improvement

The blank line appropriately separates the conditional check from the variable assignment and sanitization logic.


681-681: LGTM - Formatting improvement

The blank line improves readability by separating the early return check from the form object retrieval.

stripe/helpers/FrmStrpLiteConnectApiAdapter.php (1)

27-36: Important fix: Ensures customer_id is defined for non-admin flow

This change resolves a potential undefined variable issue. Previously, when a non-administrator cancelled a subscription, $customer_id was never assigned after retrieving the customer object, which would cause it to be undefined when passed to FrmStrpLiteConnectHelper::cancel_subscription().

The addition of line 34 ($customer_id = $customer->id;) ensures that the customer ID is properly extracted and passed to the downstream helper method, enabling non-admin users to successfully cancel their subscriptions.

stripe/helpers/FrmStrpLiteLinkRedirectHelper.php (1)

105-105: LGTM - Formatting improvement

The blank line improves readability by separating the redirect path extraction logic from the final redirect URL construction.

tests/phpunit/base/FrmUnitTest.php (2)

234-234: LGTM! Formatting improvement aligns with PR objective.

The blank line improves readability by separating the array initialization block from the subsequent variable assignments.


550-550: LGTM! Formatting improvement aligns with PR objective.

The blank line improves code organization by visually separating the foreach loop from the query variable initialization.

classes/models/FrmEntryValidate.php (3)

326-338: Blank line after filter removal is fine

This is a purely formatting change between the conditional remove_filter and $filtered_option assignment. It has no behavioral impact and matches the intended style rule.


351-372: Shortcode normalization for dynamic options looks correct

Running do_shortcode() on each option in both $values['options'] and $field_object->options before comparison makes the “dynamic options based on hook” check operate on rendered values instead of raw shortcode strings, which is consistent with how users see labels. Given this path is only taken on a failed direct match, the extra shortcode processing should not be a hot‑path bottleneck.


502-529: Formatting around final regex assembly is safe

The added blank line before prefixing/suffixing the pattern is cosmetic only and does not alter the generated regular expression.

Comment thread classes/views/shared/mb_adv_info.php
@Crabcyborg Crabcyborg merged commit 972d2f0 into master Dec 3, 2025
16 checks passed
@Crabcyborg Crabcyborg deleted the enforce_empty_line_between_end_curl_and_var_assignment branch December 3, 2025 17:16
@coderabbitai coderabbitai Bot mentioned this pull request Dec 3, 2025
stephywells pushed a commit that referenced this pull request Apr 4, 2026
…nd_curl_and_var_assignment

Enforce empty line between end curl and var assignment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant