UpCloudLtd/upcloud-php-api

Laravel 10 pakcage conflict

Closed this issue ยท 6 comments

While installing this apckage with Laravel 10 with PHP 8.1

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - symfony/serializer[v5.3.0, ..., v5.3.14] require symfony/deprecation-contracts ^2.1 -> found symfony/deprecation-contracts[v2.1.0, ..., v2.5.2] but the package is fixed to v3.3.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - laravel/framework is locked to version v10.13.0 and an update of this package was not requested.
    - upcloudltd/upcloud-php-api v2.3.0 requires symfony/serializer ^5.1 -> satisfiable by symfony/serializer[v5.1.0, ..., v5.4.24].
    - symfony/mime v6.3.0 conflicts with symfony/serializer v5.4.24.
    - symfony/mime v6.3.0 conflicts with symfony/serializer v5.4.21.
    - symfony/mime v6.3.0 conflicts with symfony/serializer v5.4.2.
    - symfony/mime v6.3.0 conflicts with symfony/serializer v5.4.0.
    - symfony/mime v6.3.0 conflicts with symfony/serializer v5.2.12.
    - symfony/mime v6.3.0 conflicts with symfony/serializer v5.2.11.
    - symfony/mime v6.3.0 conflicts with symfony/serializer v5.2.1.
    - laravel/framework v10.13.0 requires symfony/mime ^6.2 -> satisfiable by symfony/mime[v6.3.0].
    - Root composer.json requires upcloudltd/upcloud-php-api 2.3.0 -> satisfiable by upcloudltd/upcloud-php-api[v2.3.0].

Conflict is related to this package. If I update this to 6.2 it causes problems to other PHP version.
symfony/serializer package conflict

@thevilledev What do you suggest? I will create a PR accordingly.

Darep commented

Did you test upcloud-php-api with symfony/serializer@6.2? Was it working ok? If yes, then I think we could simply bump the version in composer.json. So change that to "symfony/serializer": "^5.1|^6.0", here.

Or we could make it even more relaxed, like "symfony/serializer": ">=5.1", but maybe the ^5.1|^6.0 is safer ๐Ÿ˜„

Did you test upcloud-php-api with symfony/serializer@6.2? Was it working ok? If yes, then I think we could simply bump the version in composer.json. So change that to "symfony/serializer": "^5.1|^6.0", here.

Or we could make it even more relaxed, like "symfony/serializer": ">=5.1", but maybe the ^5.1|^6.0 is safer ๐Ÿ˜„

@Darep

I have created a fork for PHP 8.1 only to get it working
Changed the following dependencies

"php": "^8.1",
"symfony/serializer": "^6.2",

Also, need some changes in the following files also

lib/Serializer.php
lib/SerializerInterface.php

However, I was unable to make it work for earlier PHP versions, so I didn't create a pull request.

Please refer to the changes here - master...sandeshjangam:upcloud-php-api:master

Seems like the package update would work with ^6.0 version of symfony/* packages if we drop support for PHP 7, which has been EOL for a while: #55.

I Added you @sandeshjangam as a co-author to the related commit in that PR as it was not obvious which commits to cherry-pick from your fork so I copied the code changes manually.

Hello, this should now be resolved in v3.0.0.

I'll close this as completed, please re-open or create a new issue, if there are still issues when installing together with Laravel.