Skip to content
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

Adding major version constant to interface #2583

Merged
merged 1 commit into from
May 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/ClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
*/
interface ClientInterface
{
/**
* The Guzzle major version.
*/
const MAJOR_VERSION = 7;

Choose a reason for hiding this comment

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

Consider renaming this to simply VERSION so it's compatible with the previous version constant?

Copy link
Member

Choose a reason for hiding this comment

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

That option probably makes the most sense. 👍

Copy link
Member

Choose a reason for hiding this comment

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

The only issue is in Guzzle 6 this had type string.

Choose a reason for hiding this comment

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

Ahh, good point. Do you think it'd be better to use a string? I think it's OK to leave as an int.

Copy link
Member

Choose a reason for hiding this comment

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

I think that we have to make it a string of we rename it. Otherwise code with strict types enabled will break.

Choose a reason for hiding this comment

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

Seems like it's not a very useful change at this point, and either the version constant should remain unchanged from guzzle 6, or it should be removed. I still am in favor of a VERSION file in the repo, but that seems like a longshot.

Copy link
Member

Choose a reason for hiding this comment

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

IMHO I am in favor of changing it to a string in order to be easier to be used to version_compare function of PHP.. but I have mixed feelings if about the naming.. not sure what's the best approach. Changing name will clear indicate that it changed format.. but it will not ease migration...

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 name is consistent with Symfony's Kernel.

I dont want to use VERSION because people might believe it is the same as in 6.x


/**
* Send an HTTP request.
*
Expand Down