Review main Merged

90090[TASK] Improve return type handling in HTTP/Stream

Garvin Hicking CR +2 V +2 Easy +2 −7 updated 07/18/25, 10:22

Commit message

PHP's `stream_get_contents()` function has a return type decleration
of "string|false". The "false" return of that function can only
happen, if the `$offset` parameter of `stream_get_contents()` is set
to a value larger than `0`. The default is `-1`, so the TYPO3 code
could never trigger a 'false' condition and throw an exception.

With this patch, no exception is thrown (because it will never happen),
and the implicit function arguments are made explicit to be better
aware of this fact.

This will allow to upgrade to PHPStan 2.1.18 without touching the
baseline (only for the 12.4 baseline, as this patch is recommended
to not be backported to the security-fix-only branch).

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
    • Benjamin Franzke +1
    • Oliver Klee +1
  • Verified V +2 Done
    • Garvin Hicking +2
    • Benjamin Franzke +1
    • Oliver Klee +1
    • core-ci +1 CI

Issues 2

Files 1

Review log 56

  1. Garvin Hicking uploaded patch set 1 07/18/25, 07:29

  2. core-ci voted on patch set 1 V +1 07/18/25, 07:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81906

  3. Benjamin Franzke voted on patch set 1 CR +1 V +1 07/18/25, 08:55

  4. Oliver Klee voted on patch set 1 CR +1 V +1 07/18/25, 08:57

  5. Garvin Hicking voted on patch set 1 CR +2 V +2 07/18/25, 09:40

  6. Garvin Hicking merged patch set 2 07/18/25, 10:22