Review main Merged

75747[TASK] Request in ContentObject is not nullable

Christian Kuhn CR +2 V +2 Easy +4 −1 updated 09/17/22, 16:09

Commit message

Single FE content objects (TEXT, IMAGE, ...) always receive
the PSR-7 request since v11: Instances are created via
ContentObjectFactory, which takes care setRequest() is
always called after instantiation.

As such, single objects can rely on $this->request being
set, the property shouldn't be nullable. Declaring the
property non-nullable will trigger a fatal PHP
"must not be accessed before initialization" error
in case setRequest() hasn't been called, which indicates
an API misuse.

The patch hardens this property.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Benjamin Franzke +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Benjamin Franzke +1
    • core-ci +1 CI

Issues 2

Files 1

Review log 79

  1. Christian Kuhn uploaded patch set 1 09/17/22, 15:47

  2. Christian Kuhn updated the commit message in patch set 2 09/17/22, 15:49

  3. Christian Kuhn uploaded patch set 3 09/17/22, 15:51

  4. core-ci voted on patch set 1 V +1 09/17/22, 16:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31207

  5. core-ci voted on patch set 3 V +1 09/17/22, 16:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31209

  6. Benjamin Franzke voted on patch set 3 V +1 CR +1 09/17/22, 16:05

  7. Stefan Bürk voted on patch set 3 V +1 CR +1 09/17/22, 16:08

  8. Stefan Bürk voted on patch set 3 V +2 CR +2 09/17/22, 16:09

  9. Stefan Bürk merged patch set 4 09/17/22, 16:09