Skip to content

Converting request defaults to strings - #426

Merged
armanist merged 1 commit into
quantum-php:masterfrom
armanist:master
Mar 15, 2026
Merged

armanist merged 1 commit into
quantum-php:masterfrom
armanist:master

Conversation

@armanist

@armanist armanist commented Mar 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

Bug Fixes

  • Improved consistency in API request parameter handling – Enhanced how pagination parameters are processed to ensure more reliable and consistent data type handling across API calls.

@coderabbitai

coderabbitai Bot commented Mar 15, 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: e1de1e61-0dab-4de3-97ba-570e530aacd4

📥 Commits

Reviewing files that changed from the base of the PR and between bc8afc2 and cc17fc4.

📒 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 are modified to cast pagination default parameters (per_page and page) to strings. The numeric constants POSTS_PER_PAGE and CURRENT_PAGE are wrapped with (string) casts before being passed as fallback values to $request->get, changing the default argument types from integers to strings.

Changes

Cohort / File(s) Summary
PostController Default Parameter Type Casting
src/Module/Templates/DemoApi/src/Controllers/PostController.php.tpl, src/Module/Templates/DemoWeb/src/Controllers/PostController.php.tpl
Default values for per_page and page parameters in the posts method are now cast to strings using (string) wrapper around self::POSTS_PER_PAGE and self::CURRENT_PAGE constants.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Poem

🐰 A hop, a cast, a string so true,
Where numbers once were, strings peek through,
Pages and posts in harmony dance,
Type safety given its rightful chance! ✨

🚥 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 reflects the main change: converting request default parameter values from integers to strings in PostController templates.
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.

@armanist
armanist merged commit 362afb8 into quantum-php:master Mar 15, 2026
5 checks passed
@codecov

codecov Bot commented Mar 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.62%. Comparing base (f7a26e1) to head (cc17fc4).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #426   +/-   ##
=========================================
  Coverage     82.62%   82.62%           
  Complexity     2717     2717           
=========================================
  Files           241      241           
  Lines          7298     7298           
=========================================
  Hits           6030     6030           
  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.

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