phar-composer icon indicating copy to clipboard operation
phar-composer copied to clipboard

Improve PHP 8.4+ support by avoiding implicitly nullable types

Open PaulRotmann opened this issue 9 months ago • 0 comments

As mentioned in #136, I would like to add support for PHP 8.4. I'm encountering similar issues as described in https://github.com/clue/graph-composer/issues/75.

While fixing the nullable types in the codebase itself is straightforward, I'm running into problems with external dependencies, specifically with knplabs/packagist-api.

The issue here is different from the previous case: The knplabs/packagist-api package is very well maintained but only supports PHP ^7.4 or ^8.0 (with version 1.x available for PHP 7.1-7.3). This creates the same fundamental compatibility problem but from the opposite direction - the dependency has moved forward with PHP version requirements while we're trying to maintain broader compatibility.

  • The nullable types can be easily fixed in our codebase to support PHP 8.4+
  • knplabs/packagist-api requires PHP ^7.4+, which limits our ability to support older PHP versions

I see two primary approaches to resolve this:

  1. Release a new major version of phar-composer that drops support for older PHP versions and only supports PHP 8.0+.

  2. Investigate and migrate to an alternative package that supports a wider range of PHP versions.

PaulRotmann avatar Jun 16 '25 16:06 PaulRotmann