odata-client-php icon indicating copy to clipboard operation
odata-client-php copied to clipboard

guzzlehttp/guzzle ^7.0 should be "suggest" in composer.json, not a hard-dependency

Open bernhardberger opened this issue 4 years ago • 3 comments

user@notebook:~/PhpStormProjects/my-project $ ddev composer require saintsystems/odata-client

Using version ^0.6.0 for saintsystems/odata-client
./composer.json has been updated
Running composer update saintsystems/odata-client
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires saintsystems/odata-client ^0.6.0 -> satisfiable by saintsystems/odata-client[0.6.0].
    - saintsystems/odata-client 0.6.0 requires guzzlehttp/guzzle ^7.0 -> found guzzlehttp/guzzle[dev-master, 7.0.0-beta.1, ..., 7.4.x-dev (alias of dev-master)] but the package is fixed to 6.5.5 (lock f
ile version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.
composer [require saintsystems/odata-client] failed, composer command failed: exit status 2. stderr=

bernhardberger avatar Apr 22 '21 10:04 bernhardberger

I just cloned the project, removed the hard dependency on Guzzle 7 and it seems to work just fine with 6.5.5?

Is this hard dependency even neccesary given that you can use the ODataClient using any class implementing the interface? Imho guzzle7 shoul be in the suggest section of the composer.json rather than being a hard dependency..

bernhardberger avatar May 05 '21 09:05 bernhardberger

@bernhardberger, I'll take a look at this. I believe you're right that this could be in the suggest section since any class implementing the interface could be used.

anderly avatar May 05 '21 21:05 anderly

Thank you!

At some point switching to a PSR17 (https://www.php-fig.org/psr/psr-17/) / httplug (http://httplug.io/) implementation might be desirable.

PS: #80 is related O think.

bernhardberger avatar May 05 '21 22:05 bernhardberger