algolia / algolia/algoliasearch-client-php

PSR http message version conflict

Open
#724 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
PHP
Stars
697
Forks
112
PR merge metrics
No merged PRs in 30d

Description

- 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 :
```json
"psr/http-message": "^1.0 || ^2.0",
```
In class `Algolia\AlgoliaSearch\Http\Psr7\Uri` the method `withScheme` has the following signature :

https://github.com/algolia/algoliasearch-client-php/blob/df4508d6ca85700d2df9b556edd18696f37fb2cd/src/Http/Psr7/Uri.php#L439

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

```php
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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading composer.json and the withScheme method in src/Http/Psr7/Uri.php around line 439, then compare its signature with the PSR HTTP Message versions named in the issue. Done means the declared PSR versions are genuinely compatible with the Uri implementation and the reported Drupal integration no longer requires the older client version.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend-api-design
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.