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

PSR http message version conflict #724

Open
NicolasPineau opened this issue Sep 29, 2023 · 3 comments
Open

PSR http message version conflict #724

NicolasPineau opened this issue Sep 29, 2023 · 3 comments

Comments

@NicolasPineau
Copy link

NicolasPineau commented Sep 29, 2023

  • Algolia Client Version: 3.4.0, 3.4.1

Description

composer./json states that either versions 1 or 2 of psr http-message are compliant :

"psr/http-message": "^1.0 || ^2.0",

In class Algolia\AlgoliaSearch\Http\Psr7\Uri the method withScheme has the following signature :

public function withScheme(string $scheme): UriInterface

which is not correct implementation of version 1 of psr/http-message related interface:

public function withScheme(string $scheme);

Experienced by using "drupal/search_api_algolia": "^3.0@beta", had to downgrade algolia/algoliasearch-client-php to 3.3.2 fo fix.

@mariofischer
Copy link

mariofischer commented Oct 24, 2023

Same happens with Shopware 5.x (and a self-implemented Algolia client). Pinning the version to 3.2.2 solves the problem for us.

@sushidub
Copy link

Promoting this issue using:

  • PHP 8.1
  • Algolia Client Version: 3.4.0, 3.4.1 (custom wordpress plugin)

The PSR conflict logs as:

PHP Fatal error: Declaration of Algolia\AlgoliaSearch\Http\Psr7\Uri::withScheme(string $scheme): Psr\Http\Message\UriInterface must be compatible with Psr\Http\Message\UriInterface::withScheme($scheme) in /code/wp-content/plugins/algolia/vendor/algolia/algoliasearch-client-php/src/Http/Psr7/Uri.php on line 439

Temporary Fix: Downgraded Algolia client to version to 3.2.2

@CedsTrash
Copy link

Hi, do we know more about this issue? It doesn't feel right to have to pin this package to version 3.3.2.

Thanks.

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

4 participants