bshaffer / oauth2-server-php

A library for implementing an OAuth2 Server in php
http://bshaffer.github.io/oauth2-server-php-docs
MIT License
3.26k stars 950 forks source link

Make the ResponseInterface Symfony 4 compliant #928

Closed X-Coder264 closed 5 years ago

X-Coder264 commented 6 years ago

This is a breaking change as the interface is now type-hinted which means that the min PHP version had to be bumped (so this should be tagged as the next major version).

Fixes https://github.com/bshaffer/oauth2-server-httpfoundation-bridge/issues/31

danopz commented 6 years ago

This would not really make it to core. The plan is already to go with PSR-7, there is just no implementation right now.

X-Coder264 commented 6 years ago

@danopz The plan to go with PSR-7 is great, but it's been 3 years since any development was done in order to achieve that goal. So it's obvious that the plan is either dead or at the very least it isn't gonna be achieved anytime soon. Meanwhile this is the only blocker that we have on our projects in order to update them to use the latest version of Laravel or Symfony (and obviously we are not the only ones). So I'd say that this is worth merging and tagging as a new (major) version. Because the only other option is to basically refactor/rewrite the entire OAuth part of our projects to use another package which isn't a small task (or we should forever stay on an outdated framework version just because of this which just isn't an option).

janzankowski commented 6 years ago

+1 For @X-Coder264 argument. This should be fixed.

bshaffer commented 5 years ago

Question - why is this a blocker for those projects? These interfaces are forwards-compatible with the latest versions of PHP.

bshaffer commented 5 years ago

I understand now, the interfaces were updates as part of the symfony package.

We may need to do some sneaky autoloading to get around this issue while maintaining BC with previous versions of PHP. Any ideas?

X-Coder264 commented 5 years ago

IMHO I don't think there is any need to do any "sneaky" stuff just to preserve BC with ancient PHP versions. As of today even PHP 7.0 reached EOL and PHP 5.6 extended support period ends at the end of the month.

bshaffer commented 5 years ago

@X-Coder264 unfortunately, in practice, those other versions of PHP are heavily used and I don't want to drop support for them just yet.

X-Coder264 commented 5 years ago

Well, we could still go with the route of tagging a new major version with this PR and then backporting all important bug fixes etc. to the 1.x branch for the foreseeable future. That seems like a better way to approach this problem that to be doing some hacky stuff just so that it can work with all PHP versions.

bshaffer commented 5 years ago

Added https://github.com/bshaffer/oauth2-server-httpfoundation-bridge/pull/34, which will fix this issue without changing interfaces or requiring autoload hacks ;)