UpCloudLtd/upcloud-php-api

Composer package conflicts

rehmatworks opened this issue · 6 comments

Can anyone please elaborate why these packages are required in composer.json with a strict version?

doctrine/instantiator
doctrine/annotations

I see that these packages aren't being used anywhere in the code but they are resulting in conflicts while using this package with latest Laravel. If these packages are required by any dependency, then that dependency should handle these installations. Please shed some light on this issue.

Darep commented

Good point, thank you! 👍

It seems to me that the original author of this library was working on using phpDocumentor (and Symfony) to generate a website for the documentation and added those dependencies. They seem unnecessary to me as well now.

We'll take a look to confirm and hopefully can remove those 😊

Thank you :) That's great.

In the meantime, if its an issue for you, you can create a fork, then in the fork create a branch named composer-fix and edit the upcloud-php-api composer.json in the fork/branch down to just:

"require": {
    "php": ">=5.5",
    "ext-curl": "*",
    "ext-json": "*",
    "ext-mbstring": "*",
    "guzzlehttp/guzzle": "^6.3"
  },

...then in your own project's composer.json file, do this to include your fork but not change all the names/etc:

"repositories":
    [
        {
            "type": "vcs",
            "url": "https://github.com/<your-account-name>/upcloud-php-api"
        }
    ],
"require": {
        /* ...your other requires... */
        "upcloudltd/upcloud-php-api": "dev-composer-fix"
    },

...and it should work fine. Use the library as documented. (And once they cut those un-needed dependencies, just revert your composer file to normal and update.)

Note that the dev- prefix in your composer file should not be part of the branch name you create...that's not a mistake. And feel free to use https://github.com/rgreer4/upcloud-php-api if you don't want to bother with the fork/edits.

@rgreer4 Thank you. I wrote an entirely new package as I faced a lot of issues utilizing this official package.

Darep commented

I created a PR for removing the packages, it worked for my tests at least: #22 – pretty much changes composer.json as @rgreer4 suggested here :) The composer.lock still contains a lot of doctrine and symfony requires though...

Fixed in #49 and released in v2.2.0.