Skip to content

feat!: PHP client requires PHP >=7.2.5 and Guzzle ^7.4 - #12768

Open
ewaostrowska wants to merge 2 commits into
masterfrom
fix-ci
Open

ewaostrowska wants to merge 2 commits into
masterfrom
fix-ci

Conversation

@ewaostrowska

@ewaostrowska ewaostrowska commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

BREAKING CHANGE: PHP client now requires PHP >=7.2.5 and Guzzle ^7.4

Breaking change for users

Regenerating a PHP client with this version produces a composer.json with new minimum requirements:

Requirement Before After
php >=5.5 >=7.2.5
guzzlehttp/guzzle ^6.2 ^7.4
squizlabs/php_codesniffer (dev) ~2.6 ^3.0

Who is affected

Anyone who regenerates a PHP client (-l php) with this version of Swagger Codegen. Clients that were already generated are not affected until they are regenerated.

What can break

  • PHP < 7.2.5 (5.5 to 7.1): composer install refuses to install the regenerated client. The PHP runtime must be upgraded first.
  • Guzzle 6 conflicts: an application that requires guzzlehttp/guzzle ^6 (directly or through another package) cannot install a client that requires ^7.4.
  • Guzzle 7 API changes: Guzzle 7 changed some type hints and method signatures. Code may break if it:
    • passes a custom HTTP client to the generated Configuration / Api classes,
    • implements or mocks Guzzle interfaces (for example ClientInterface fakes in tests),
    • depends on Guzzle 6 specific exception or response behavior.
  • Dev tooling: custom phpcs rulesets written for php_codesniffer 2.x may need updates for 3.x.

Migration

  1. Upgrade the runtime to PHP 7.2.5 or newer.
  2. Upgrade or unpin guzzlehttp/guzzle to ^7.4 in the consuming application.
  3. Review any custom Guzzle client, mock or fake passed to the generated client.
  4. Regenerate the client and run composer update.

Users who must stay on PHP < 7.2.5 or Guzzle 6 should keep using their already generated client, or pin the previous Swagger Codegen version.

What changed

  • php/composer.mustache: PHP >=7.2.5, Guzzle ^7.4, codesniffer ^3.0.
  • php-symfony/composer.mustache: codesniffer ^3.0. The PHP constraint is unchanged because this generator does not use Guzzle.

The generator Java code and the api.mustache template are unchanged. The deprecated Guzzle helpers used there (\GuzzleHttp\json_encode, Psr7\try_fopen) still work in Guzzle 7 and are not part of this change.

Why

CI for the PHP samples needs current dependencies. Guzzle 6 and codesniffer 2.x are unmaintained, and Guzzle 7 is the supported line. Guzzle 7 requires PHP >=7.2.5, so the php constraint is raised to match. Otherwise the constraint would be wrong.

@ewaostrowska ewaostrowska changed the title Fix ci feat!: PHP client requires PHP >=7.2.5 and Guzzle ^7.4 Sep 29, 2026
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