Review main Merged

90900[TASK] Cleanup TYPO3\CMS\Core\Http\Response

Torben Hansen CR +2 V +2 Normal +22 −62 updated 10/05/25, 11:13

Commit message

This change performs some simple cleanups in the
`TYPO3\CMS\Core\Http\Response` class.

* Use native type for constructor argument `$body`
* Remove type check for `$body` variable in constructor
* Remove redundant type casts
* Remove superfluous `canBeInterpretedAsInteger` check for
  integer-typed variable
* Remove self-explaining doc comments
* Wrap doc comments to a maximum line length of 80 chars
* Remove unneeded `@return` doc comments

Unit tests have been adapted to check for a `TypeError`
exception, when invalid data is provided for the `$body`
argument in the constructor.

The phpstan baseline has been adjusted and all
excludes for the class have been removed.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Garvin Hicking +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Benni Mack +2
    • Garvin Hicking +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 1

Files 3

Review log 1116

  1. Torben Hansen uploaded patch set 1 10/04/25, 10:35

  2. core-ci voted on patch set 1 V -1 10/04/25, 10:42 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86005

  3. Torben Hansen uploaded patch set 2 V -1 10/04/25, 10:56

  4. core-ci voted on patch set 2 V -1 10/04/25, 11:02 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86006

  5. Torben Hansen uploaded patch set 3 V -1 10/04/25, 11:49

  6. core-ci voted on patch set 3 V -1 10/04/25, 11:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86007

  7. Torben Hansen uploaded patch set 4 V -1 10/04/25, 12:21

  8. core-ci voted on patch set 4 V +1 10/04/25, 12:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86009

  9. Chris Müller commented on patch set 4 10/04/25, 12:37

    Response.php:116

    Wouldn't it be simpler to just check with is_string()?
  10. Torben Hansen uploaded patch set 5 V +1 10/04/25, 17:16

  11. Torben Hansen commented on patch set 5 10/04/25, 17:17

    Response.php:116 Reply

    Good catch. I added the `is_string` check which resulted in additional removal of 2 phpstan baseline excludes.
  12. core-ci voted on patch set 5 V +1 10/04/25, 17:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86016

  13. Simon Schaufelberger voted on patch set 5 CR +1 V +1 10/04/25, 17:28

  14. Garvin Hicking voted on patch set 5 CR +1 V +1 10/04/25, 21:00

  15. Benni Mack voted on patch set 5 CR +2 V +2 10/05/25, 11:13

  16. Benni Mack merged patch set 6 10/05/25, 11:13