Skip to content

Add support for psr/http-message v2.0 #151

Description

@samuelszabo

Problem

The library currently only supports psr/http-message ^1.0, which causes dependency conflicts when trying to install it in projects that use psr/http-message 2.0.

Error Message

Problem 1
    - lmc/matej-client[3.1.0, 4.0.0, ..., 4.1.0] require psr/http-message ^1.0 
      -> found psr/http-message[1.0, 1.0.1, 1.1] but the package is fixed to 2.0 
      (lock file version) by a partial update and that version does not match.

Solution

Update composer.json to allow both versions:

"psr/http-message": "^1.0 || ^2.0"

Why This Is Safe

The only breaking change in psr/http-message v2.0 is the addition of return type declarations to the PSR-7 interfaces. Since this library:

  1. Only consumes the PSR-7 interfaces (uses them as type hints)
  2. Doesn't implement or extend the PSR-7 interfaces directly
  3. Already has return type declarations on its own methods

Both versions are compatible. The library will work correctly with either v1.x or v2.x.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions