Reviewed & tested by the community
Project:
Drupal core
Version:
main
Component:
other
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
18 Aug 2026 at 19:27 UTC
Updated:
30 Sep 2026 at 17:46 UTC
Jump to comment: Most recent
Comments
Comment #3
bt dev2 commentedI removed the unnecessary cast from DateTimePlus's __toString() method.
I noticed the render() method itself doesn't have a : string return type declared. Do we need to add a : string there?
Comment #5
smustgrave commentedLooking at #3548957: Deprecate ToStringTrait
core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.phpalso appears to have a redundant typecast that could be removedComment #6
bt dev2 commentedRemoved redundant typecast from TranslatableMarkup::__toString()
Comment #7
smustgrave commentedphpstorm definitely flagged it as redundant but get a test failure so maybe it was wrong?
Comment #8
prudloff commentedThis probably means the type we document in the docblock is not always respected.
Comment #11
smustgrave commented@zeeshan_khan can you please stop going around opening MRs where ones already exist please.
Comment #12
zeeshan_khan commented@smustgrave You're right, I shouldn't have opened a second MR - sorry about that. Closing mine. One thing worth flagging on !16827 itself: it also touched TranslatableMarkup::__toString(), which is what broke LinkBaseTest - that part might be worth dropping from !16827 and tracking separately." Post that as a comment on !16827 or the issue, not as its own MR.
Comment #13
quietone commentedThe title doesn't make sense to me.
Comment #14
prudloff commentedI reverted the title.
Comment #15
jacobupal commentedSeems like the novice aspect of this task is complete, current state is "Needs review" which would be better for a more-than-novice person. Removing the Novice tag now to help move things forwards (here in Issue Triage at DrupalCon Rotterdam 2026).
Comment #16
dcam commentedThe additional change to
TranslatableMarkup::__toString()was removed.For the sake of being thorough I verified that the output will always be a string.
DateTimePlus::render()only returns a concatenated string value. So while the string return type isn't enforced by a type hint it will always be a string as the code exists now.I don't think there's much else to say about this, so I'll RTBC it.