invoiceninja / sdk-php

PHP wrapper for Invoice Ninja's REST API
https://www.invoiceninja.com
83 stars 42 forks source link

I think the library requires PHP 8.1 #102

Closed mattwelke closed 1 year ago

mattwelke commented 1 year ago

I tried creating a new composer.json file today and installing the latest version of the library. I did this by running composer require invoiceninja/sdk-php like the page https://packagist.org/packages/invoiceninja/sdk-php says to. After doing this, my composer.json file looked like this:

{
    "require": {
        "invoiceninja/sdk-php": "^1.1"
    }
}

I also had a composer.lock file (contents omitted here because it's much larger).

When I tried to use composer to install packages using the composer.json and composer.lock files on a system using PHP 8.0, I get the following error:

Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - symfony/deprecation-contracts is locked to version v3.2.1 and an update of this package was not requested.
    - symfony/deprecation-contracts v3.2.1 requires php >=8.1 -> your php version (8.0.27) does not satisfy that requirement.
  Problem 2
    - symfony/deprecation-contracts v3.2.1 requires php >=8.1 -> your php version (8.0.27) does not satisfy that requirement.
    - guzzlehttp/guzzle 7.5.0 requires symfony/deprecation-contracts ^2.2 || ^3.0 -> satisfiable by symfony/deprecation-contracts[v3.2.1].
    - guzzlehttp/guzzle is locked to version 7.5.0 and an update of this package was not requested.

This is despite the page https://packagist.org/packages/invoiceninja/sdk-php currently showing:

requires

php: ^7.4|^8.0|^8.1
[guzzlehttp/guzzle](https://packagist.org/packages/guzzlehttp/guzzle): ^7.3

So I think a transitive dependency is pushing the PHP requirement up to 8.1. I'm pretty new to the PHP ecosystem so I'm not sure what the norms are here, if you should update the minimum PHP version for the library itself to 8.1, or if the library user is expected to investigate transitive dependencies themselves. Because I was unsure, I thought I'd mention it here in case you find this report useful.

Thanks!

turbo124 commented 1 year ago

I'll bump the dependencies for this and tag a new release

turbo124 commented 1 year ago

https://github.com/invoiceninja/sdk-php/releases/tag/v1.2.0