Skip to content

PHP 8 compat #35

Open
Open
@XedinUnknown

Description

@XedinUnknown

The Problem

The package cannot be installed on PHP 8 from master, producing the following error:

Error: Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - webmozart/path-util is locked to version dev-master and an update of this package was not requested.
    - webmozart/path-util dev-master requires php ^5.3.3|^7.0 -> your php version (8.0.2) does not satisfy that requirement.
  Problem 2
    - webmozart/path-util dev-master requires php ^5.3.3|^7.0 -> your php version (8.0.2) does not satisfy that requirement.
    - webmozart/path-util 2.3.x-dev is an alias of webmozart/path-util dev-master and thus requires it to be installed too.
    - webmozart/path-util is locked to version 2.3.x-dev and an update of this package was not requested.

  Problem 1
    - webmozart/path-util is locked to version dev-master and an update of this package was not requested.
    - webmozart/path-util dev-master requires php ^5.3.3|^7.0 -> your php version (8.0.2) does not satisfy that requirement.
  Problem 2
    - webmozart/path-util dev-master requires php ^5.3.3|^7.0 -> your php version (8.0.2) does not satisfy that requirement.
    - webmozart/path-util 2.3.x-dev is an alias of webmozart/path-util dev-master and thus requires it to be installed too.
    - webmozart/path-util is locked to version 2.3.x-dev and an update of this package was not requested.

Error: Process completed with exit code 2.

Possible Cause

2.3 declares compatibility from PHP 5.3.3 to infinity, implicitly allowing PHP 8.
master removes this compatibility by declaring ^5.3.3|^7.0.

Suggested Solution

Explicitly declare compatibility with PHP 8, e.g. ^5.3.3|^7.0|^8.0.

Remarks

While the point of the solution to explicitly add PHP 8.0 to the list of supported versions stands, I am not entirely sure that it is possible to resolve dependencies to any list of constraints that will support both PHP 5.3 and PHP 8.

Therefore, the solution may be also the followig:

  1. Add a new branch 2.3.x, and keep the current constraint ^5.3.3|^7.0 there.
  2. Rewind master to 2.3.0, because dev-master is supposed to represent the latest stable version. This is important, because otherwise lower stability in dependants breaks everything.
  3. Add a new branch e.g. 2.4.x, and declare ^7.0|^8.0 there (or a higher version, like 7.1 or 7.2 even, because unless you composer update on CI, there is no single PHPUnit version that can support the whole range of declared PHP versions).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions