Skip to content

fix: restore the 1.4.2 public API - #633

Open
SNO7E-G wants to merge 1 commit into
google:mainfrom
SNO7E-G:fix/restore-1.4.2-public-api
Open

fix: restore the 1.4.2 public API#633
SNO7E-G wants to merge 1 commit into
google:mainfrom
SNO7E-G:fix/restore-1.4.2-public-api

Conversation

@SNO7E-G

@SNO7E-G SNO7E-G commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

1.5.0 introduced backward-incompatible changes in a minor release (#628). This restores src/ and tests/ to the 1.4.2 tag verbatim, so the library is behaviourally identical to 1.4.2 for every consumer.

Verification: git diff 1.4.2 -- src is empty. There are no source changes to review.
Restored by reverting rather than by re-implementing:

  • untyped public signatures with phpdoc, no native param or return types
  • no return type on the RequestMethod::submit() interface
  • non-readonly Response and RequestParameters
  • the Curl and Socket wrapper classes and their ?Curl / ?Socket dependency-injection constructors, so the documented pattern for testing a custom RequestMethod works again

1.4.2 predates the phpstan level max and php-cs-fixer setup; this repo now runs in CI, and reports 191 pre-existing errors, 62 of them in src/. Many of those, such as offset access on mixed and resource parameters, cannot be resolved with annotations alone. Changing code in a revert would defeat the purpose of the revert, so they are recorded in phpstan-baseline.neon instead. The follow-up hardening removes entries from it as it adds the guards that fix them. php-cs-fixer needed no changes to the 1.4.2 sources.

phpunit 52 passing, phpstan clean against the baseline, php-cs-fixer clean.

1.5.0 introduced backward-incompatible changes in a minor release (google#628).
This restores src/ and tests/ to the 1.4.2 tag verbatim, so the library is
behaviourally identical to 1.4.2 for every consumer.

Verification: `git diff 1.4.2 -- src` is empty. There are no source changes
to review, and no version constant is touched here, since choosing and
tagging the release is the maintainers' call.

Restored by reverting rather than by re-implementing:
- untyped public signatures with phpdoc, no native param or return types
- no return type on the RequestMethod::submit() interface
- non-readonly Response and RequestParameters
- the Curl and Socket wrapper classes and their ?Curl / ?Socket
  dependency-injection constructors, so the documented pattern for testing
  a custom RequestMethod works again

1.4.2 predates the phpstan level max and php-cs-fixer setup this repo now
runs in CI, and reports 191 pre-existing errors, 62 of them in src/. Many
of those, such as offset access on mixed and resource parameters, cannot be
resolved with annotations alone. Changing code in a revert would defeat the
purpose of the revert, so they are recorded in phpstan-baseline.neon
instead. The follow-up hardening removes entries from it as it adds the
guards that fix them. php-cs-fixer needed no changes to the 1.4.2 sources.

phpunit 52 passing, phpstan clean against the baseline, php-cs-fixer clean.
@SNO7E-G
SNO7E-G marked this pull request as draft July 27, 2026 22:07
@SNO7E-G
SNO7E-G marked this pull request as ready for review July 27, 2026 22:24
@acoulton

Copy link
Copy Markdown

@SNO7E-G thanks for this - I've reviewed git diff 1.4.2..SNO7E-G/fix/restore-1.4.2-public-api and it looks correct to me.

There are changes to examples files that were after 1.4.2 but before / separate to the code changes, and the changes to the CI / phpstan config, I agree that it's appropriate to keep those and to add the phpstan baseline to resolve the warnings.

@rowan-m if you're happy with this would it be possible to get it merged and released as 1.5.1 to fix the issues with 1.5.0, and as a baseline for future improvements?

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