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

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 2

Files 1