Allow to use backed enumerations as route name - #296
Open
KalimeroMK wants to merge 1 commit into
Open
Conversation
KalimeroMK
force-pushed
the
enum-route-name
branch
from
September 4, 2026 14:54
5177bd6 to
d3dfbc3
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #296 +/- ##
========================================
Coverage 0.00% 0.00%
Complexity 129 129
========================================
Files 13 13
Lines 400 399 -1
========================================
+ Misses 400 399 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
KalimeroMK
force-pushed
the
enum-route-name
branch
2 times, most recently
from
September 4, 2026 15:06
0d30772 to
002f5ac
Compare
`Route::name()` now accepts a backed enumeration in addition to a string. The enumeration is resolved to its backing value immediately, so route names are still stored and returned as strings. `Route` is final and `name()` is not part of any interface, so this needs no backward-compatibility baseline entry and no bump of the "yiisoft/router-implementation" version. The change in `RouteCollection.php` is unrelated: Rector rewrites that line on every run, and applying it keeps the "rector-cs" job from committing it.
KalimeroMK
force-pushed
the
enum-route-name
branch
from
September 5, 2026 07:00
002f5ac to
a4f1d95
Compare
Member
|
https://github.com/yiisoft/router-fastroute should be adjusted and released along with this one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #280.
Route::name()now accepts a backed enumeration in addition to a string. The enumeration is resolved to its backing value immediately, so route names are still stored and returned as strings.Routeis final andname()is not part of any interface, so there are no interface changes, no BC baseline entries and noyiisoft/router-implementationbump.Widening the route name in
RouteCollectionInterfaceandUrlGeneratorInterfaceis deliberately left out: it is not BC for classes implementing them and needs a coordinateddummy-provider+router-fastroute+routerrelease. Discussed in #280.RouteCollection.phpis the only unrelated change — Rector rewrites that line on every run, and applying it keepsrector-csfrom committing it.