Review 13.4 Merged

89977[TASK] Simplify workspace CommandMap class

Christian Kuhn CR +2 V +2 Hard +169 −398 updated 07/02/25, 17:56

Commit message

The workspaces CommandMap class is called by the workspaces
DataHandlerHook. It manipulates the incoming DataHandler
commandMap to sanitize, add and remove workspaces related
"jobs" early.

The implementation is mind-bogglingly over-abstracted and
has so many layers of indirectness that it's extremely hard
to follow and understand what it actually does. The patch is
a chainsaw simplification of especially the CommandMap class.

* Reduce CommandMap to a single public API method that retrieves
  all incoming state and returns the manipulated commandMap.
* Free __construct() from manual arguments and use it for DI.
* Separate the three main code paths 'publish', 'setState' and
  'discard' from each other to end up with significantly more
  straight forward code.
* Dissolve all constants by directly inlining code and get rid
  of $this->scopes.
* Directly call class methods instead of $this->$method() to
  see which are actually used from where and which arguments
  are given.
* Inline a series of one-liner helper methods directly into
  callers.
* Avoid DependencyResolver->setOuterMostParentsRequireReferences()
  and its class state property: DependencyResolver is instantiated
  exactly twice and both set the property true.
* Move ElementEntityProcessor->transformDependentElementsToUseLiveId()
  into CommandMap.
* Inline CollectionService->getDependencyCallback() to consumers
  to remove yet another level of indirection.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
  • Verified V +2 Done
    • Christian Kuhn +2
    • core-ci +1 CI

Issues 1

Files 5

Review log 34

  1. Christian Kuhn uploaded patch set 1 07/02/25, 17:21

  2. core-ci voted on patch set 1 V +1 07/02/25, 17:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81253

  3. Christian Kuhn voted on patch set 1 CR +2 V +2 07/02/25, 17:55

  4. Christian Kuhn merged patch set 2 07/02/25, 17:56