Skip to content

Stop returning function return results by reference#2834

Merged
Crabcyborg merged 2 commits into
masterfrom
remove_returning_results_by_reference
Jan 19, 2026
Merged

Stop returning function return results by reference#2834
Crabcyborg merged 2 commits into
masterfrom
remove_returning_results_by_reference

Conversation

@Crabcyborg
Copy link
Copy Markdown
Contributor

@Crabcyborg Crabcyborg commented Jan 19, 2026

I believe these were all added unintentionally and don't really impact functionality.

Summary by CodeRabbit

  • Refactor
    • Simplified internal return handling across multiple components for consistency and maintainability; no user-facing behavior or UI changes.

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

@Crabcyborg Crabcyborg added this to the 6.28 milestone Jan 19, 2026
@Crabcyborg Crabcyborg changed the title Stop returning function results by reference Stop returning function return results by reference Jan 19, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 19, 2026

📝 Walkthrough

Walkthrough

This PR removes by-reference return types from several public methods across the codebase, changing their signatures to return by value while leaving internal logic and control flow unchanged.

Changes

Cohort / File(s) Summary
Controller method
classes/controllers/FrmStylesController.php
Removed & from public static function &important_style(...)public static function important_style(...); now returns by value.
Helper methods
classes/helpers/FrmFieldsHelper.php
Removed & from public static function &label_position(...)public static function label_position(...); return path simplified but behavior preserved.
Model methods
classes/models/FrmForm.php, stripe/models/FrmTransLiteDb.php
Removed & from public static function &is_visible_to_user(...) and from public function &destroy(...) → both return by value.
Stub declarations
stubs.php
Removed & from three stubbed methods: FrmProEntryMetaHelper::value_exists(...), FrmProFormsHelper::post_type(...), FrmProFieldsHelper::is_field_visible_to_user(...); signatures now return by value.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 I hopped through code, removed the ampersand,
Returned by value, neat and grand.
No references clinging to the night,
Functions lighter, signatures bright.
Hooray — a cleaner, simpler land! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 77.78% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main change: removing reference return types from multiple function signatures across the codebase.

✏️ 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 d1319ed into master Jan 19, 2026
16 checks passed
@Crabcyborg Crabcyborg deleted the remove_returning_results_by_reference branch January 19, 2026 21:19
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