Skip to content

Upgrade to PHPUnit 13 and php-jwt 7, fix PHP 8.1+ compatibility - #23

Open
comanche wants to merge 4 commits into
allenmichael:masterfrom
comanche:master
Open

Upgrade to PHPUnit 13 and php-jwt 7, fix PHP 8.1+ compatibility#23
comanche wants to merge 4 commits into
allenmichael:masterfrom
comanche:master

Conversation

@comanche

Copy link
Copy Markdown
Contributor

Upgrade dependencies to PHPUnit 13 and php-jwt 7, fix PHP 8.1+ compatibility

Bumps firebase/php-jwt and phpunit/phpunit to current major versions and resolves the breakage that came with them. Verified against the live Box API on PHP 8.4.

Changes

Dependencies

  • firebase/php-jwt ^6.10^7.1
  • phpunit/phpunit ^10.5^13.2

PHPUnit 13 migration

  • Replaced the unsupported /** @test */ docblock annotation with the #[Test] attribute. Under PHPUnit 13 the old annotation is silently ignored, so the suite was discovering zero tests and exiting without running anything.
  • Removed the PHPUnit-7-era root attributes (backupStaticAttributes, convertErrorsToExceptions, convertNoticesToExceptions, convertWarningsToExceptions) that now fail schema validation.
  • Added a first-party fail-on-issues policy: failOnNotice / failOnWarning / failOnDeprecation, scoped to src/ via a <source> block so vendor-internal issues don't fail the build.

PHP 8.1+ deprecation fix

  • Added the : mixed return type to BoxModel::jsonSerialize(). PHP 8.1 gave JsonSerializable a tentative return type, so implementations without one emit a deprecation — now enforced by failOnDeprecation.

Explicit PHP floor

  • Added "php": ">=8.1" to composer.json. The floor was already implied by php-jwt ^7.1 and the : mixed return type; this makes installs on older PHP fail fast with a clear message.

Compatibility

Minimum PHP is now 8.1 (was already effectively 8.0 via the php-jwt upgrade). No change to the public SDK API — auth, client, and manager logic are untouched.

Testing

Full suite passes against the live Box API: OK (14 tests, 174 assertions), zero deprecations.

comanche added 4 commits June 18, 2026 16:19
Replace the unsupported /** @test */ docblock annotation with the
#[Test] attribute so tests are discovered again, and update the
phpunit config: drop the removed PHPUnit-7-era root attributes that
fail schema validation, and add a first-party fail-on-issues policy
(failOnNotice/failOnWarning/failOnDeprecation scoped to src/).
JsonSerializable::jsonSerialize() requires a declared return type; add
": mixed" to clear the PHP 8.1+ deprecation now enforced by failOnDeprecation.
Make the runtime floor self-documenting. It was already implied by
firebase/php-jwt ^7.1 (php ^8.0) and the JsonSerializable ": mixed"
return type; pin >=8.1 so installs on older PHP fail fast with a clear
message instead of a runtime error.
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.

1 participant