Skip to content

fix: raise generated dependency floors to PHP 8.5 deprecation-free releases - #161

Merged
tommey merged 2 commits into
masterfrom
feature/php-8.5-clean-dependency-floors
Sep 28, 2026
Merged

tommey merged 2 commits into
masterfrom
feature/php-8.5-clean-dependency-floors

Conversation

@tommey

@tommey tommey commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Generated clients target CLIENT_PHP_VERSION 8.3 ("php": "^8.3") and run unchanged on PHP 8.5, but their composer.json still let Composer resolve dependency releases that raise PHP 8.4+ deprecations inside the client. This PR raises only those floors. CLIENT_PHP_VERSION, the templates and the generated code are all unchanged.

Generated composer.json

Package Before After Why
docler-labs/api-client-exception ^1.0 || ^2.0 ^1.0 || ^2.3.1 2.0.0–2.3.0 raise an implicit-nullable deprecation in UnexpectedResponseException (fixed in 2.3.1)
guzzlehttp/psr7 (Guzzle HTTP message) ^1.6 || ^2.6 ^1.6 || ^2.7 2.6.x raises a deprecation in Uri.php that the generated GuzzleRequestMapper hits

The 1.x lines stay, so the older targets still resolve: api-client-exception 1.x needs ^7.0, psr7 1.x needs >=5.4. On PHP 7.4 and later, Composer can now only pick releases that run deprecation-free on PHP 8.5.

Examples

  • The example and example3_1 lockfiles move to api-client-exception 2.3.1 (from 2.0.0) and psr7 2.13.1. The acceptance tests exercise these, and on PHP 8.5 they used to fail with deprecations as errors.
  • A separate commit syncs the committed example BodySerializer with the current generator output. The acceptance run regenerates it, and the committed copy was older than the RFC 6839 +json support released in 11.2.0.

Verification

  • make test (PHP 8.2 + wiremock, as CI runs it): OK, 449 tests, 1038 assertions.
  • php-cs-fixer dry run: 0 files to fix. PHPStan: no errors.
  • Unit + functional on PHP 8.5.10: OK, 447 tests.
  • Acceptance on PHP 8.5.5 with error_reporting=-1: OK, 2 tests, and the generated example clients raise no deprecations. (The generator's own dev dependency composer/composer 2.2.30 LTS still prints deprecations on 8.5. That affects only the test harness, not generated code; CI runs on 8.2.)
  • Separately, generated clients from 33 specs, for targets 7.0–8.3, were linted, checked with PHPStan (phpVersion: 80500) and exercised at runtime on PHP 8.5. After api-client-exception 2.3.1, their only remaining deprecation source is gone.

CHANGELOG entry: 11.2.3. It also covers the composer/composer 2.2.30 bump from #160.

🤖 Generated with Claude Code

tommey and others added 2 commits September 28, 2026 11:49
…leases

Generated composer.json now requires docler-labs/api-client-exception
^1.0 || ^2.3.1 and guzzlehttp/psr7 ^1.6 || ^2.7, so on PHP 7.4+ Composer
can only resolve releases that run without PHP 8.4+ deprecations. The
1.x lines stay allowed for the older CLIENT_PHP_VERSION targets.

The example and example3_1 lockfiles move to api-client-exception 2.3.1,
so the acceptance tests pass on PHP 8.5 with deprecations as errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The acceptance tests regenerate example/ and example3_1/ PetStoreClient.
The committed copies predated 11.2.0, so BodySerializer lacked the RFC 6839
+json content type handling the generator already emits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tommey
tommey merged commit 2918a9e into master Sep 28, 2026
2 checks passed
@tommey
tommey deleted the feature/php-8.5-clean-dependency-floors branch September 28, 2026 10:08
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