Skip to content

Enforce phpcs useless variable Slevomat rule and php cs fixer return_assignment rule#2736

Merged
Crabcyborg merged 2 commits into
masterfrom
enforce_phpcs_useless_variable_rule
Jan 7, 2026
Merged

Enforce phpcs useless variable Slevomat rule and php cs fixer return_assignment rule#2736
Crabcyborg merged 2 commits into
masterfrom
enforce_phpcs_useless_variable_rule

Conversation

@Crabcyborg
Copy link
Copy Markdown
Contributor

No description provided.

@Crabcyborg Crabcyborg changed the title Enforce phpcs useless variable rule Enforce phpcs useless variable Slevomat rule Jan 7, 2026
@Crabcyborg Crabcyborg added this to the 6.27 milestone Jan 7, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 7, 2026

Walkthrough

This PR removes intermediate local variables across multiple files, replacing them with direct return statements. The changes affect controller, helper, and model classes, including FrmFormsController, FrmEntriesListHelper, FrmFormsListHelper, FrmStylesHelper, and FrmAntiSpam, maintaining identical functionality throughout.

Changes

Cohort / File(s) Summary
Variable elimination and direct returns
classes/controllers/FrmFormsController.php, classes/helpers/FrmEntriesListHelper.php, classes/helpers/FrmFormsListHelper.php, classes/helpers/FrmStylesHelper.php, classes/models/FrmAntiSpam.php
Simplifies functions by removing intermediate variables ($message, $hex, $form_token_string) and returning computed values directly via return statements. No functional changes; purely refactoring for code clarity.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive No description was provided by the author, making it impossible to evaluate whether the description relates to the changeset. Add a description explaining the purpose of enforcing the PHPCS useless variable rule and its benefits.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Title check ✅ Passed The title accurately describes the main objective of the pull request: enforcing phpcs useless variable and php cs fixer return_assignment rules across multiple files.

✏️ 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 changed the title Enforce phpcs useless variable Slevomat rule Enforce phpcs useless variable Slevomat rule and php cs fixer return_assignment rule Jan 7, 2026
@Crabcyborg Crabcyborg merged commit 829bb3f into master Jan 7, 2026
16 checks passed
@Crabcyborg Crabcyborg deleted the enforce_phpcs_useless_variable_rule branch January 7, 2026 20:35
stephywells pushed a commit that referenced this pull request Apr 4, 2026
…le_rule

Enforce phpcs useless variable Slevomat rule and php cs fixer return_assignment rule
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