Skip to content

Fatal Compile Error: Declaration of Http\Client\Socket\Stream::close() must be compatible #14

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

Closed
Rid opened this issue Oct 13, 2023 · 5 comments

Comments

@Rid
Copy link
Member

Rid commented Oct 13, 2023

Unless I use "psr/http-message": "1.1" in composer.json, I get the error:

Declaration of Http\Client\Socket\Stream::close() must be compatible

Looks related to: php-http/socket-client#69

Can anyone reproduce? If so we might need to update our composer.json

@flavioheleno
Copy link
Member

Got to reproduce the error.

By reading the issue and related discussions, we may need to replace php-http/socket-client with relevant PSR interfaces - at least PSR18 -, and suggest one or more implementations.

@Rid
Copy link
Member Author

Rid commented Oct 16, 2023

I'm personally already using https://github.com/guzzle/guzzle which also has socket support.

Are there any other suggestions?

@flavioheleno
Copy link
Member

I'd suggest Guzzle as well and maybe symfony/http-client, but any of the packages that provide psr/http-client-implementation should be ok as long as they provide unix socket support.

Shall we move with this:

in docker-php-api:

  1. Remove nyholm/psr7 under require;
  2. Remove php-http/socket-client under suggest
  3. Add psr/http-client-implementation under require;
  4. Add psr/http-factory-implementation under require;
  5. Add psr/http-message-implementation under require.

in docker-php:

  1. Replace php-http/socket-client with psr/http-client-implementation;
  2. Remove php-http/client-common;
  3. Replace nyholm/psr7 with psr/http-message-implementation;
  4. Remove php-http/httplug-bundle under suggest;
  5. Add guzzlehttp/guzzle under suggest.

Those changes will leave the actual implementation of the underlying transport (HTTP) to the project using docker-php and docker-php-api and no longer force any packages, but suggest guzzlehttp/guzzle as a viable implementation.

@Rid
Copy link
Member Author

Rid commented Oct 16, 2023

@flavioheleno All looks good to me 👍

@flavioheleno
Copy link
Member

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

No branches or pull requests

2 participants