Skip to content

Fix some mago linting issues (inline-variable-return, no-redundant-pa…#2896

Merged
Crabcyborg merged 1 commit into
masterfrom
fix_some_mago_linting_issues
Jan 28, 2026
Merged

Fix some mago linting issues (inline-variable-return, no-redundant-pa…#2896
Crabcyborg merged 1 commit into
masterfrom
fix_some_mago_linting_issues

Conversation

@Crabcyborg
Copy link
Copy Markdown
Contributor

@Crabcyborg Crabcyborg commented Jan 28, 2026

…rentheses)

Summary by CodeRabbit

  • Style

    • Removed redundant parentheses throughout the codebase to improve code readability and consistency.
  • Refactor

    • Simplified code by inlining intermediate variables and returning results directly instead of multi-step assignments.
  • Chores

    • Updated linter configuration to remove disabled formatting rules, enabling stricter code style enforcement.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 28, 2026

📝 Walkthrough

Walkthrough

This PR systematically removes redundant parentheses from expressions across multiple PHP files and disables related linter rules in the configuration. All changes are syntactic formatting improvements with no functional impact on control flow or behavior—semantic equivalence is maintained while improving code readability.

Changes

Cohort / File(s) Summary
Controllers
classes/controllers/FrmEntriesController.php, classes/controllers/FrmFormActionsController.php, classes/controllers/FrmSettingsController.php, classes/controllers/FrmXMLController.php
Removed extra parentheses wrapping ternary and null-coalescing expressions in function arguments. No impact to control flow or runtime behavior.
Helpers & Models
classes/helpers/FrmFormsHelper.php, classes/models/FrmEntryMeta.php, classes/models/FrmFieldFormHtml.php, classes/models/fields/FrmFieldCheckbox.php, classes/models/fields/FrmFieldRadio.php
Removed redundant parentheses from boolean and ternary expressions in method calls and assignments. All formatting changes; behavior unchanged.
Views
classes/views/frm-forms/settings.php, classes/views/frm-settings/payments.php
Removed redundant parentheses from null-coalescing expressions passed to call_user_func() invocations. No semantic changes.
Stripe Module
stripe/controllers/FrmTransLiteCRUDController.php, stripe/models/FrmTransLiteDb.php
Inlined intermediate variables in return statements; minor formatting adjustments. Preserves query logic and result handling.
Configuration
mago.toml
Disabled two linter rule configurations: no-redundant-parentheses and inline-variable-return.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 ✨ Hop through the code, I'll clean with care,
Strip excess parens floating there!
From callbacks to ternaries, parentheses fall,
Mago.toml says "no more walls!"
Cleaner syntax, same behavior,
Code style's the 🐇 code-cleaner's savior! 🌟

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective—fixing mago linting issues related to redundant parentheses and inline variable returns—and is directly supported by the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 91.67% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

@Crabcyborg Crabcyborg merged commit 75d8603 into master Jan 28, 2026
37 of 39 checks passed
@Crabcyborg Crabcyborg deleted the fix_some_mago_linting_issues branch January 28, 2026 15:03
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