Follow up of #29 (comment)
then we cannot share trait with Collection, or we can, but those NoDiscard will have no runtime effect..
here is a solution - maybe a little bit cumbersome but working
https://3v4l.org/mFDBn#v8.5.8
I think another thing to keep in mind is that adding the #[NoDiscard] attribute is a BC break (actually it only triggers a warning, but I guess in Symfony application, in dev/test env the error handler does actually throw) although removing the attribute is not a BC break, so if we're actually undecided, I think the most prudent approach would be to add it first.
Follow up of #29 (comment)
here is a solution - maybe a little bit cumbersome but working
https://3v4l.org/mFDBn#v8.5.8
I think another thing to keep in mind is that adding the
#[NoDiscard]attribute is a BC break (actually it only triggers a warning, but I guess in Symfony application, in dev/test env the error handler does actually throw) although removing the attribute is not a BC break, so if we're actually undecided, I think the most prudent approach would be to add it first.