Closed (fixed)
Project:
Drupal core
Version:
10.0.x-dev
Component:
routing system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
19 Sep 2022 at 08:54 UTC
Updated:
23 Sep 2026 at 18:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
hemuvyas97 commentedComment #3
hemuvyas97 commentedComment #4
wim leersInterface docs:
string as a typehint tends to imply that as long as a
Stringableobject is returned, it's fine. But https://www.php.net/manual/en/class.stringable.php only exists since PHP 8, which is why the interface docs indicate juststring.In Drupal 10, we'll be able to make this better though!
What do you think about this as an alternative? 😊
Comment #5
cilefen commentedWhy is this a support request?
Comment #6
wim leersComment #7
smustgrave commentedMakes sense to me. And my ide will thank you!
Comment #8
chi commentedWill there be any problems if we add native PHP typehints to the method?
Comment #9
wim leers@Chi If we don't have to care about PHP 7 support, then we indeed could … if we did a BC break: https://3v4l.org/WYop7
Code in that experiment:
… so AFAICT, we unfortunately can't do that.
Comment #10
chi commented@Wim Leers, aren't BC breaks still acceptable for Drupal 10?
Comment #11
wim leersDrupal 10 is in beta, so … no. The API is frozen.
Comment #13
smustgrave commentedMoving back to RTBC seemed ot be a random failure.
Comment #14
alexpottFixing the issue title to match what we're doing
Comment #15
alexpottCommitted and pushed 6d34fc2b74 to 10.1.x and efeb6f0ec2 to 10.0.x. Thanks!
Comment #19
kuldeepbarot commentedUpdated this patch to make it compatible with Drupal10.5.10
Comment #20
kuldeepbarot commentedRe-roled #19 for D11.4.6