Skip to content

Drop PHP 5.x/7.x support, require PHP >=8.0 - #8

Open
mazfreelance wants to merge 1 commit into
devjack:masterfrom
mazfreelance:support/php-8.0-8.5
Open

mazfreelance wants to merge 1 commit into
devjack:masterfrom
mazfreelance:support/php-8.0-8.5

Conversation

@mazfreelance

Copy link
Copy Markdown

composer.json pinned spomky-labs/base64url ^1.0 (caps at PHP 7) and spomky-labs/php-aes-gcm ^1.2 (PHP 5.6 fallback), both of which turned out to be dead weight: Base64Url was imported in RFC8188.php but never called, and AESGCM only ran inside a version_compare(phpversion(), '7.0.0', '>') branch unreachable on any PHP version in real use.

  • Remove spomky-labs/php-aes-gcm entirely; always use the native openssl_encrypt/openssl_decrypt AEAD GCM path (stable since PHP 7.1)
  • Move spomky-labs/base64url to require-dev (only the test suite uses it); bump 1.0 -> 2.0, same encode()/decode() API
  • Fix a real PHP 8.1 deprecation this exposed: $keyid defaulted to null and flowed into strlen()/bin2hex(), both deprecated for null input as of 8.1 - normalize with $keyid = $keyid ?? ''
  • Remove the two tests whose sole purpose was proving PHP 5.6/7.1 cross-compatibility between the two now-merged code paths
  • Bump phpunit/phpunit ^5 -> ^9.6; drop the random_compat polyfill note from the README; update Dockerfile base image and .travis.yml PHP matrix (5.6/7.1/7.2 -> 8.0-8.5 + nightly)

Verified with the real test suite (6 tests, 6 assertions, zero warnings) on PHP 8.0, 8.1, 8.4, and 8.5.12.

BREAKING CHANGE: drops PHP <8.0 support.

composer.json pinned spomky-labs/base64url ^1.0 (caps at PHP 7) and
spomky-labs/php-aes-gcm ^1.2 (PHP 5.6 fallback), both of which turned
out to be dead weight: Base64Url was imported in RFC8188.php but never
called, and AESGCM only ran inside a `version_compare(phpversion(),
'7.0.0', '>')` branch unreachable on any PHP version in real use.

- Remove spomky-labs/php-aes-gcm entirely; always use the native
  openssl_encrypt/openssl_decrypt AEAD GCM path (stable since PHP 7.1)
- Move spomky-labs/base64url to require-dev (only the test suite uses
  it); bump 1.0 -> 2.0, same encode()/decode() API
- Fix a real PHP 8.1 deprecation this exposed: $keyid defaulted to
  null and flowed into strlen()/bin2hex(), both deprecated for null
  input as of 8.1 - normalize with $keyid = $keyid ?? ''
- Remove the two tests whose sole purpose was proving PHP 5.6/7.1
  cross-compatibility between the two now-merged code paths
- Bump phpunit/phpunit ^5 -> ^9.6; drop the random_compat polyfill
  note from the README; update Dockerfile base image and .travis.yml
  PHP matrix (5.6/7.1/7.2 -> 8.0-8.5 + nightly)

Verified with the real test suite (6 tests, 6 assertions, zero
warnings) on PHP 8.0, 8.1, 8.4, and 8.5.12.

BREAKING CHANGE: drops PHP <8.0 support.
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.

2 participants