Skip to content

Conversation

@klsoft-web
Copy link
Contributor

Q A
Is bugfix?
New feature?
Breaks BC?
Fixed issues #277

@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.72%. Comparing base (7b4d133) to head (beab738).
⚠️ Report is 23 commits behind head on master.

Additional details and impacted files
@@              Coverage Diff              @@
##             master     #279       +/-   ##
=============================================
- Coverage     97.40%   72.72%   -24.68%     
+ Complexity      181      178        -3     
=============================================
  Files            16       16               
  Lines           577      550       -27     
=============================================
- Hits            562      400      -162     
- Misses           15      150      +135     

☔ 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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes ordering restrictions around adding middleware in Route and Group, aligning behavior with issue #277 so middleware can be added both before and after actions/routes.

Changes:

  • Allow Route::middleware() to be called after action() by inserting middleware before the action handler.
  • Allow Route::prependMiddleware() to be called before action() (always prepends).
  • Remove Group ordering restrictions so middleware can be added before/after routes() and vice versa, and update tests/changelog accordingly.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/Route.php Adjusts middleware() behavior to insert before action when action is present; removes prependMiddleware() restriction.
src/Group.php Removes state flags/exceptions that enforced ordering between routes() and middleware methods.
tests/RouteTest.php Replaces exception-based tests with assertions covering new Route middleware ordering behavior.
tests/GroupTest.php Updates tests to reflect relaxed ordering constraints in Group.
CHANGELOG.md Documents enhancement #277.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

klsoft-web and others added 3 commits February 7, 2026 13:18
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@samdark samdark requested a review from vjik February 8, 2026 19:41
@vjik vjik requested a review from a team February 9, 2026 06:59
@vjik vjik added the status:code review The pull request needs review. label Feb 9, 2026
@samdark samdark merged commit 7be2f65 into yiisoft:master Feb 9, 2026
22 of 24 checks passed
@samdark
Copy link
Member

samdark commented Feb 9, 2026

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:code review The pull request needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants