Skip to content

Follow Tempest custom route decorators - #560

Open
shuvroroy wants to merge 2 commits into
PHPantom-dev:mainfrom
shuvroroy:feat/tempest-route-decorators
Open

shuvroroy wants to merge 2 commits into
PHPantom-dev:mainfrom
shuvroroy:feat/tempest-route-decorators

Conversation

@shuvroroy

Copy link
Copy Markdown
Contributor

Custom Tempest route decorators now contribute their literal URI prefixes, so a call such as uri('/admin/v1/books/{book}', book: 'php') completes and navigates to the controller action and its parameter. URI parameter references and renames follow the decorated path too.

The implementation preserves method-before-class decorator order, resolves inherited and trait methods in their declaring file, and distinguishes Prefix path joining from PHP string concatenation. Built-in-only routes retain their precomputed URI; custom decorator results are shared within each request. The playground verifies the generated links with Tempest's own router.

Validation:

  • Full cargo test suite passes.
  • cargo clippy --fix --allow-dirty -- -D warnings, then cargo fmt, and cargo clippy --all-targets -- -D warnings pass.
  • LLVM coverage verifies 100% of changed executable Rust lines, including all executable lines of the new decorator module.
  • All contributing-guide PHP lint and runtime assertion checks pass. Framework analysis is clean, with exactly the four intentional Laravel errors documented by the guide.

Checklist:

  • Updated the changelog and documentation.
  • Added regression tests and working playground examples.
  • Removed the completed roadmap item.
  • Reviewed the generated code and user-facing text.

Read literal Prefix delegation and URI concatenation in RouteDecorator
implementations, using the declaring namespace and PHP member precedence.
Apply method decorators before class decorators for route completion,
navigation, and parameter references and renames.

Keep built-in URI prefixes precomputed and memoize custom decorators within
each request. Cover supported bodies, recovery, namespace collisions,
inherited methods, unsaved edits, and literal slash behavior.
Add Admin and Versioned decorators to the playground and verify their
combined URI with Tempest's own discovery and URI generator. Document the
behavior, credit the contribution, and remove the completed roadmap item.
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@shuvroroy
shuvroroy marked this pull request as ready for review November 9, 2026 04:21

This branch has not been deployed

No deployments
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.

2 participants