mezzio-hal icon indicating copy to clipboard operation
mezzio-hal copied to clipboard

Drop PHP 7.4 and add support for `psr/link` v2

Open internalsystemerror opened this issue 2 years ago • 5 comments

Q A
Documentation no
Bugfix no
BC Break no
New Feature yes
RFC no
QA yes

Description

Best I could do to avoid BC breaks was to:

  • Update minimum supported PHP version to 8.0
  • Widen psr/link to include ^2.0 (closes https://github.com/mezzio/mezzio-hal/pull/58)
  • Add static return types where a fatal error would take place
  • Add remaining type errors to psalm-baseline.xml

internalsystemerror avatar Sep 14 '22 18:09 internalsystemerror

@internalsystemerror cb73daf is extraneous: please rebase instead

Ocramius avatar Sep 14 '22 18:09 Ocramius

I'm converting this to a draft as it clearly needs more work. If we're targeting a new major, should I update all method signatures to match psr/link v2 and drop support for v1?

internalsystemerror avatar Sep 14 '22 18:09 internalsystemerror

and drop support for v1?

Your pick: @weierophinney may have a stronger opinion perhaps?

Supporting both would mean a new BC break release once we drop v1 (due to added signatures)

Ocramius avatar Sep 14 '22 18:09 Ocramius

Supporting both would mean a new BC break release once we drop v1 (due to added signatures)

So, the PSR evolution by-law suggests doing a new minor that targets 1.1, and which adds only a return typehint, as that's technically a non-BC break; however, the by-law misses that any class extending the implementation would experience a BC break unless they add the return typehint, as they'd be widening the return type.

And, of course, as soon as you also add support for the new major of a PSR, you MUST jumpt to a new major in your implementation, due to the signature change, even if you support both versions (and we could support both 1.1 and 2.0 at that point).

So, :+1: from me to bump to new major, and I think we can do ^1.1 || ^2.0 when we do (but verify!).

weierophinney avatar Sep 26 '22 16:09 weierophinney

Can't do it in 1.1 due to inherent BC breaks

Ocramius avatar Sep 26 '22 16:09 Ocramius