Skip to content

Allow deprecation-contracts 3#2961

Merged
GrahamCampbell merged 2 commits into
guzzle:masterfrom
derrabus:bump/contracts-3
Dec 6, 2021
Merged

Allow deprecation-contracts 3#2961
GrahamCampbell merged 2 commits into
guzzle:masterfrom
derrabus:bump/contracts-3

Conversation

@derrabus

@derrabus derrabus commented Dec 1, 2021

Copy link
Copy Markdown
Contributor

No description provided.

@GrahamCampbell GrahamCampbell merged commit 1d347d7 into guzzle:master Dec 6, 2021
@derrabus derrabus deleted the bump/contracts-3 branch December 6, 2021 22:58
@simondotws

Copy link
Copy Markdown

@derrabus @GrahamCampbell v3.0 of deprecation-contracts requires a minimum version of PHP8.0 so causes issues for people still on PHP7

@GrahamCampbell

Copy link
Copy Markdown
Member

It won’t, because we did not drop v2.

@simondotws

Copy link
Copy Markdown

Installing causes a composer version error as it installs 3.0.0 by default with a PHP version of >=8.0.2 so it requires --ignore-platform-reqs to avoid the error.

@GrahamCampbell

Copy link
Copy Markdown
Member

This is only because you generated your lock file using PHP 8 or did not include the proper platform config in your app's composer.json file to force it to fetch PHP 7.4 compatible dependencies.

@GrahamCampbell

Copy link
Copy Markdown
Member

it requires --ignore-platform-reqs to avoid the error.

I would highly, highly recommend not doing that, as the code you install will fail at runtime, and not actually work.

@togethernet

Copy link
Copy Markdown

This is only because you generated your lock file using PHP 8 or did not include the proper platform config in your app's composer.json file to force it to fetch PHP 7.4 compatible dependencies.

What would be the proper platform config in composer.json to force fetch PHP 7.4 compatible dependencies?

@mhamann

mhamann commented Mar 29, 2022

Copy link
Copy Markdown

You could set (though I don't recommend):

{
  "config": {
    "platform": {
      "php": "7.4"
    }
  }
}

You lose flexibility and can have weird stuff happen when explicitly setting the platform here, because you're basically forcing composer to ignore the actual version of PHP you're using.

Instead, just make sure that you're using the correct version of PHP CLI. For example, I ran into this and in my case, my server was running PHP 7.4, but my command line was using PHP 8.1. So, when doing an install of guzzle, I was getting a version of symfony/deprecation-contracts that was incompatible with the server PHP version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants