http-interop / http-middleware

PSR-15 interfaces for HTTP Middleware
MIT License
73 stars 7 forks source link

ResponseInterface as return type #61

Closed cdekok closed 7 years ago

cdekok commented 7 years ago

It would be nice if the interface was bumped to PHP 7 and forces the ResponseInterface as return type in the MiddleWareInterface.

shadowhand commented 7 years ago

I agree it would be nice but I think that's a pretty unlikely scenario at this time. I am not entirely sure how the FIG handles versioning, but I wouldn't mind seeing a 1.0.0 that is 5.x compatible, and a 2.0.0 that is 7.x compatible.

jschreuder commented 7 years ago

As PHP 5.6 is EOL/security-fixes-only it would be defensible. The PSR would probably only be used in new projects which should target 7.0 anyway.

Could this be decided with a separate vote? As to not endanger passage at all over this.

weierophinney commented 7 years ago

We're planning on adding support for this in Stratigility, which supports PHP 5.6; moving to 7 is not an option for us currently. As such, I'd prefer not to force that version at this point.

On Jan 18, 2017 11:48 AM, "Jelmer Schreuder" notifications@github.com wrote:

As PHP 5.6 is EOL/security-fixes-only it would be defensible. The PSR would probably only be used in new projects which should target 7.0 anyway.

Could this be decided with a separate vote? As to not endanger passage at all over this.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/http-interop/http-middleware/issues/61#issuecomment-273548027, or mute the thread https://github.com/notifications/unsubscribe-auth/AABlVwo4yKUTMKGk4Fmzuub0sqWOcl9Jks5rTlBugaJpZM4Lm_FG .

akrabat commented 7 years ago

For what it's worth, Slim is also supporting 5.6 and we are not moving to 7 when we introduce support for this.

schnittstabil commented 7 years ago

As far as I can see, we only have these options:

  1. PSR-15 does not use return type-hinting i. and will never do (maybe PSR-51 will do[*]) ii. and will do it at v2.0.0
  2. PSR-15 use return type-hinting only
  3. PSR-15 use return type-hinting and non-return type-hinting (i.e. 4 interfaces: two middleware plus two delegate interfaces)

[*] within a new namespace of course

– Does anybody see further options?

damianopetrungaro commented 7 years ago

The versioning topic has been discussed in FIG Mailing list. No BC will be provided for this kind of update.

shadowhand commented 7 years ago

The PSR version of these interfaces could target PHP7 exclusively. I'm not strictly opposed, except that PHP 5.6 is not yet EOL and even when it is, there will be a fair number of people that continue to use it. (Hopefully not too many.)

Regardless, this debate should be had on the FIG mailing list, not here.