Skip to content

chore: remove php-http/socket-client<2.0 support #418

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
Jul 31, 2022

Conversation

qkdreyer
Copy link
Contributor

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

https://github.com/php-http/socket-client/blob/master/src/Client.php#L51

@ostrolucky
Copy link
Collaborator

This is incomplete. We can pass array there only for >=2.0, so we need to add conflict section

@qkdreyer qkdreyer force-pushed the patch-2 branch 2 times, most recently from 867c94b to 69e2faa Compare June 21, 2022 13:37
@qkdreyer qkdreyer changed the title fix: allow configuration of php-http/socket-client fix: allow configuration of php-http/socket-client >=2.0 Jun 21, 2022
@qkdreyer
Copy link
Contributor Author

fixed the CI

@ostrolucky
Copy link
Collaborator

This is not solving deprecation now, though. Why not sticking to original solution and just add conflict section?

@qkdreyer
Copy link
Contributor Author

I’m not sure how you would like to implement that… using try/catch or reflection ?

@@ -31,6 +31,6 @@ public function createClient(array $config = [])
throw new \LogicException('To use the Socket client you need to install the "php-http/socket-client" package.');
}

return new Client($this->messageFactory, $config);
return new Client($this->messageFactory, $config, $config);
Copy link
Collaborator

Choose a reason for hiding this comment

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

thanks for looking into this.

i think the actual bug here is in the socket client. the aim was to be BC with version 1, but deprecate passing that factory. the signature of version 1 was correct for how we instantiated the client: https://github.com/php-http/socket-client/blob/v1.4.1/src/Client.php#L52

version 2 should at https://github.com/php-http/socket-client/blob/47e68cade6b76e7fcaaf648048845d9dde0accf9/src/Client.php#L61 should use $config2, not $config which i don't see how it could be useful...

i suggest we fix the socket client to work as intended. we could additionally add a version constant into the socket client to allow the bundle to call the constructor in a future proof way and avoid the deprecation warning.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@joelwurtz what do you think, would it make sense that way?

dbu referenced this pull request in php-http/socket-client Jun 21, 2022
@dbu
Copy link
Collaborator

dbu commented Jun 21, 2022

I’m not sure how you would like to implement that… using try/catch or reflection ?

you could mark a conflict with socket-client < 2.0 in the composer section. then new versions of this bundle can only be installed with a socket-client version 2, but not version 1.

i think that is the best solution for the bundle. we should also fix the BC logic of the socket client to actually work as intended, but thats a different repo.

@dbu
Copy link
Collaborator

dbu commented Jul 25, 2022

@qkdreyer do you have time to update this?

@qkdreyer
Copy link
Contributor Author

@qkdreyer qkdreyer force-pushed the patch-2 branch 2 times, most recently from 963a4a9 to dd48646 Compare July 30, 2022 12:25
@qkdreyer qkdreyer changed the title fix: allow configuration of php-http/socket-client >=2.0 chore: chore: remove php-http/socket-client<2.0 support Jul 30, 2022
@qkdreyer qkdreyer changed the title chore: chore: remove php-http/socket-client<2.0 support chore: remove php-http/socket-client<2.0 support Jul 30, 2022
@qkdreyer qkdreyer requested a review from dbu July 30, 2022 12:28
Copy link
Collaborator

@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 a lot!

@dbu dbu merged commit 551bd65 into php-http:master Jul 31, 2022
@qkdreyer qkdreyer deleted the patch-2 branch July 31, 2022 10:46
@dbu
Copy link
Collaborator

dbu commented Aug 19, 2022

the socket client is now also fixed in version 2.1.1 to have the intended BC with version 1.

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