Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP dependency conflict: "psr/http-message" now requires PHP 7.2 #37

Open
leoloso opened this issue May 2, 2023 · 3 comments
Open

PHP dependency conflict: "psr/http-message" now requires PHP 7.2 #37

leoloso opened this issue May 2, 2023 · 3 comments

Comments

@leoloso
Copy link

leoloso commented May 2, 2023

Cortex does not lock the required version of "psr/http-message":

{
  "require": {
    "psr/http-message": "*"
  }
}

This package released v2 requiring PHP 7.2, and it updated the signature of its methods to make use of PHP 7.2 features.

Now, when using Cortex with PHP 7.1, we get an error:

2023-04-08T08:15:22.016874876Z [Sat Apr 08 08:15:22.016525 2023] [php:error] [pid 1179] [client 172.19.0.2:59764] PHP Fatal error:  Declaration of Brain\\Cortex\\Uri\\PsrUri::getScheme() must be compatible with Psr\\Http\\Message\\UriInterface::getScheme(): string in /app/wordpress/wp-content/plugins/graphql-api/vendor/brain/cortex/src/Cortex/Uri/PsrUri.php on line 55

If Cortex were to still require PHP 5.5, I guess the best way to fix the issue is to lock the dependency to version 1.0.1, which is the last version on PHP 5.3.

@leoloso
Copy link
Author

leoloso commented May 2, 2023

(Btw, I am able to run psr/http-message v2 on PHP 7.1 thanks to Rector's PHP downgrade library)

@gmazzap
Copy link
Collaborator

gmazzap commented Sep 18, 2023

Hi @leoloso

In @tfrommen PRs #40 and #41 the requirement has been changed to < 1.1. This will prevent usages with more modern versions, but prevent issues.

This is a temporary solution to have the library working on modern version of PHP without much issues.

I want to release a major version of Cortex that address this in a more solid way.

Moreover, I'll try to make the v1 series compatible with modern dependencies, but I can't promise I'll be able to do it.

@zngly-vlad
Copy link

@gmazzap

Is it possible to remove the lock onpsr/http-message from <1.1
This is preventing me from installing any packages with "psr/http-message": "^1.1 || ^2.0"

Any update would be much appreciated :)

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

No branches or pull requests

3 participants