Skip to content

Add support for symfony/http-client #139

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 1 commit into from
Jun 24, 2019
Merged

Add support for symfony/http-client #139

merged 1 commit into from
Jun 24, 2019

Conversation

nicolas-grekas
Copy link
Collaborator

@nicolas-grekas nicolas-grekas commented Jun 19, 2019

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Related tickets #138
Documentation n/a
License MIT

Checklist

  • Updated CHANGELOG.md to describe BC breaks / deprecations | new feature | bugfix
  • Documentation pull request not needed

@@ -104,7 +116,7 @@ public static function getCandidates($type)
}
}

return $candidates;
return array_merge($candidates, self::$classes[Psr18Client::class]);
Copy link
Collaborator Author

@nicolas-grekas nicolas-grekas Jun 19, 2019

Choose a reason for hiding this comment

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

this ensures that the order of discovery is the same for httplug and psr18 clients

Copy link
Contributor

Choose a reason for hiding this comment

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

with autodiscovery, it could be kind of tricky to change the ordering - people might rely on getting a specific client and this change could trip them up. if they refactor to psr-18 and then get a different client, i think that is less surprising than just updating discovery.

@Nyholm i think you wrote this originally. was the intention of the ordering to prefer the psr-18 clients when psr-18 is requested?

i would tend to revert this change. but can be convinced otherwise ;-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since only buzz is listed explicitly in the psr18 list, this means ppl that have both buzz and something else will get the something else instead. People that don't have buzz won't see a difference.
But having Symfony before Guzzle when PSR18 is loaded, and Guzzle before Symfony when httplug is is more weird.

Copy link
Contributor

Choose a reason for hiding this comment

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

right. plus when we add to the PSR18 list, we might prepend another client (like the symfony client, which has some chance of being installed unwittingly when upgrading dependencies...). well anyways, discovery is the yolo approach :-)

waiting for @Nyholm to give his opinion too.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, My intention was to prefer PSR18 clients over other clients.

Just note: Our BC promise does not include "what client".

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

reverted, I'll let you care in another PR if you do :)

Copy link
Contributor

@dbu dbu left a comment

Choose a reason for hiding this comment

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

thanks, cool to have this in here!

the build fails are for antique php versions - i will clean up the build matrix in a separate PR.

pending the decision on reordering candidates...

Copy link
Member

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

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

I like this PR. Thank you!

@@ -104,7 +116,7 @@ public static function getCandidates($type)
}
}

return $candidates;
return array_merge($candidates, self::$classes[Psr18Client::class]);
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, My intention was to prefer PSR18 clients over other clients.

Just note: Our BC promise does not include "what client".

@Nyholm Nyholm merged commit 73e5506 into php-http:master Jun 24, 2019
@nicolas-grekas nicolas-grekas deleted the sf branch June 24, 2019 16:47
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.

3 participants