Review 14.3 Merged

94813[TASK] Avoid unset() on protected class properties

Benni Mack CR +2 V +2 Easy +1 −2 updated 07/17/26, 14:38

Commit message

PHP 8.4 introduced property hooks. A subclass may redeclare an
inherited non-private property and attach hooks to it. Calling
unset() on such a property then throws a runtime Error
("Cannot unset hooked property"), which makes unset() on any
protected property of a non-final class a latent crash.

PHPStan reports this as "unset.possiblyHookedProperty" when
analyzing with phpVersion 8.4 or higher.

The affected places reset the property to its default value
right away anyway, so the unset() calls can safely be replaced
by plain default value assignments.

Review

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

Issues 1

Files 2

Review log 34

  1. Benni Mack commented on patch set 1 07/17/26, 14:00

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 07/17/26, 14:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104883

  3. Benni Mack voted on patch set 1 CR +2 V +2 07/17/26, 14:38

  4. Benni Mack merged patch set 2 07/17/26, 14:38