Skip to content

Cast search parameter to string before trimming in PostController templates - #429

Merged
armanist merged 2 commits into
quantum-php:masterfrom
armanist:master
Mar 16, 2026
Merged

armanist merged 2 commits into
quantum-php:masterfrom
armanist:master

Conversation

@armanist

@armanist armanist commented Mar 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Refactor
    • Adjusted search parameter handling operations in controller templates for improved code clarity.

@coderabbitai

coderabbitai Bot commented Mar 16, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: acf1c714-2e4f-42c4-821c-ff3e9ebb1814

📥 Commits

Reviewing files that changed from the base of the PR and between 8aa62ea and 130f946.

📒 Files selected for processing (2)
  • src/Module/Templates/DemoApi/src/Controllers/PostController.php.tpl
  • src/Module/Templates/DemoWeb/src/Controllers/PostController.php.tpl

📝 Walkthrough

Walkthrough

Two PostController template files update search parameter handling by reordering the trim and string casting operations. The functional behavior remains equivalent across both template variants.

Changes

Cohort / File(s) Summary
PostController Parameter Handling
src/Module/Templates/DemoApi/src/Controllers/PostController.php.tpl, src/Module/Templates/DemoWeb/src/Controllers/PostController.php.tpl
Reorders string casting and trimming for the query parameter: changes from (string) trim($request->get('q')) to trim((string) $request->get('q')) in the posts() method.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • softberg/quantum-php-core#426: Also modifies PostController::posts request parameter handling, specifically addressing string casting for pagination parameters.

Poem

🐰 A rabbit hops through ordered code,
Cast then trim, or trim then cast,
Same result down the logic road,
A tiny swap that's built to last!

🚥 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 clearly and accurately describes the main change: reordering the string casting and trimming operations in PostController templates to cast before trimming.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

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.

@codecov

codecov Bot commented Mar 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.63%. Comparing base (8aa62ea) to head (130f946).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #429   +/-   ##
=========================================
  Coverage     82.63%   82.63%           
  Complexity     2719     2719           
=========================================
  Files           241      241           
  Lines          7300     7300           
=========================================
  Hits           6032     6032           
  Misses         1268     1268           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@armanist
armanist merged commit d57cea0 into quantum-php:master Mar 16, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant