Review main Merged

89967[TASK] Simplify workspace CommandMap class

Christian Kuhn CR +2 V +2 Hard +176 −419 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.
* Turn CommandMap into a stateless service.
* 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
    • Stefan Bürk +1
    • Benni Mack +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Stefan Bürk +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 5

Review log 2850

Show 1325 earlier messages
  1. Christian Kuhn uploaded patch set 1 07/01/25, 17:39

  2. core-ci voted on patch set 1 V -1 07/01/25, 17:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81198

  3. Christian Kuhn uploaded patch set 2 V -1 07/01/25, 18:52

  4. Christian Kuhn uploaded patch set 3 07/01/25, 18:59

  5. core-ci voted on patch set 2 V -1 07/01/25, 19:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81199

  6. core-ci voted on patch set 3 V -1 07/01/25, 19:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81200

  7. Christian Kuhn uploaded patch set 4 V -1 07/01/25, 21:37

  8. core-ci voted on patch set 4 V +1 07/01/25, 21:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81204

  9. Christian Kuhn uploaded patch set 5 V +1 07/01/25, 21:51

  10. Christian Kuhn uploaded patch set 6 07/01/25, 22:01

  11. core-ci voted on patch set 5 V +1 07/01/25, 22:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81205

  12. core-ci voted on patch set 6 V +1 07/01/25, 22:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81206

  13. Christian Kuhn uploaded patch set 7 V +1 07/01/25, 22:20

  14. Christian Kuhn uploaded patch set 8 07/01/25, 22:26

  15. core-ci voted on patch set 7 V +1 07/01/25, 22:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81207

  16. core-ci voted on patch set 8 V +1 07/01/25, 22:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81208

  17. Christian Kuhn uploaded patch set 9 V +1 07/01/25, 22:53

  18. core-ci voted on patch set 9 V +1 07/01/25, 23:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81209

  19. Christian Kuhn uploaded patch set 10 V +1 07/01/25, 23:26

  20. core-ci voted on patch set 10 V +1 07/01/25, 23:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81210

  21. Christian Kuhn uploaded patch set 11 V +1 07/01/25, 23:36

  22. core-ci voted on patch set 11 V +1 07/01/25, 23:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81211

  23. Christian Kuhn uploaded patch set 12 V +1 07/01/25, 23:45

  24. core-ci voted on patch set 12 V +1 07/01/25, 23:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81212

  25. Christian Kuhn uploaded patch set 13 V +1 07/01/25, 23:55

  1. Christian Kuhn uploaded patch set 14 07/02/25, 00:00

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

  3. core-ci voted on patch set 14 V +1 07/02/25, 00:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81214

  4. Christian Kuhn uploaded patch set 15 V +1 07/02/25, 00:13

  5. Christian Kuhn uploaded patch set 16 07/02/25, 00:16

  6. Christian Kuhn uploaded patch set 17 07/02/25, 00:17

  7. core-ci voted on patch set 15 V +1 07/02/25, 00:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81215

  8. core-ci voted on patch set 16 V -1 07/02/25, 00:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81216

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

  10. Christian Kuhn uploaded patch set 18 V +1 07/02/25, 07:57

  11. core-ci voted on patch set 18 V +1 07/02/25, 08:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81234

  12. Christian Kuhn uploaded patch set 19 V +1 07/02/25, 08:21

  13. Christian Kuhn uploaded patch set 20 07/02/25, 08:23

  14. core-ci voted on patch set 19 V +1 07/02/25, 08:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81235

  15. core-ci voted on patch set 20 V +1 07/02/25, 08:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81236

  16. Christian Kuhn uploaded patch set 21 V +1 07/02/25, 08:37

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

  18. Christian Kuhn uploaded patch set 22 V +1 07/02/25, 09:18

  19. Christian Kuhn commented on patch set 22 07/02/25, 09:19

    Note the single patch sets reflect the entire refactoring process quite nicely: Nearly every patch set takes care of a single topic.
  20. core-ci voted on patch set 22 V +1 07/02/25, 09:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81239

  21. Benni Mack voted on patch set 22 CR +1 V +1 07/02/25, 09:38

  22. Stefan Bürk commented on patch set 22 CR -1 07/02/25, 12:23

    Reviewing ...
  23. Stefan Bürk voted on patch set 22 CR +1 V +1 07/02/25, 14:34

  24. Christian Kuhn voted on patch set 22 CR +2 V +2 07/02/25, 17:56

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