Skip to content

Added a way to be forward compatible with version 2.0 #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Dec 29, 2018
Merged

Conversation

Nyholm
Copy link
Member

@Nyholm Nyholm commented Dec 28, 2018

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Related tickets
Documentation
License MIT

To avoid updating all our plugins and the HTTPlug bundle, we can be forward compatible.
https://3v4l.org/pn47M
https://3v4l.org/2kgtG

@dbu
Copy link
Contributor

dbu commented Dec 28, 2018

hm. i see what you want to do. but is it worth it? are the separate plugins that complicated? i'd rather tag a last 1.x version of those and then move to 2.x. there should be no other things depending on those plugins, so the cost of having a major version seems minimal to me.

@Nyholm
Copy link
Member Author

Nyholm commented Dec 28, 2018

HttplugBundle is also effected since it has a custom plugin and a custom client.

@GrahamCampbell
Copy link
Contributor

I think this small BC layer is probably a good idea. Much less work for upgrading, and much less messy for trying to deal with 1.x and 2.x existing at the same time. Otherwise, we risk php-http ironically causing dependency conflicts and mess, with some people needing 1.x and others 2.x, purely because of the interface incompatibility of these 2 classes.

@sagikazarmark
Copy link
Member

On one hand I'm not sure it's worth it, on the other hand dependency conflicts already happen in the php-http ecosystem, so anything that makes it less possible should at least be considered. If it works, I'm okay with it.

Side note: should we rather make these abstract classes traits? extends makes me itching...

@dbu
Copy link
Contributor

dbu commented Dec 29, 2018

okay, okay, convinced me ;-)

traits should work fine too: https://3v4l.org/ai0TG (and i tried, if we don't implement the abstract method, we get a php error that the abstract method is not implemented)

do we want to change to a trait for this? what i like about the trait is that the plugins still explicitly implement Plugin, rather than implementing it indirectly by extending the base class.

@Nyholm
Copy link
Member Author

Nyholm commented Dec 29, 2018

Traits are better. Sure!

@dbu
Copy link
Contributor

dbu commented Dec 29, 2018

looks good to me. pretty-ci seems to be a bit flaky these days :-(

@Nyholm
Copy link
Member Author

Nyholm commented Dec 29, 2018

No, it is our config file in master: https://github.com/php-http/client-common/blob/master/.php_cs

This is fixed in 2.x

@dbu dbu merged commit dc9a9eb into master Dec 29, 2018
@dbu dbu deleted the patch-forward branch December 29, 2018 08:20
{
abstract protected function doHandleRequest(RequestInterface $request, callable $next, callable $first);

public function handleRequest(RequestInterface $request, callable $next, callable $first)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this missing the return type hint?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for master (ie 1.9.0).

Here we should be compatible with httplug 1. Check #133 for httplug 2.0.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I didn't see that PR yet. 👍

{
abstract protected function doSendRequest(RequestInterface $request);

public function sendRequest(RequestInterface $request)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants