Review main Merged Breaking

82159[!!!][TASK] Clean up Context

Christian Kuhn CR +2 V +2 Hard +216 −366 updated 12/18/23, 10:52

Commit message

The constructor of class Context is unfortunate: It
needs to be registered in DI container to be injectable.
If an extension uses GU::makeInstance() with manual
constructor arguments of this class, it could shortcut
the container lookup and would create an own instance
not registered in the container, which could lead to
a second instance when Context is injected. The
constructor is only used in tests, tests are adapted
and constructor removed with the patch.

Also, the two classes ContextAwareInterface and
ContextAwareTrait look as if they are general things
that can be used similar to the PSR-3 LoggerAwareInterface
which is handled directly in DI / makeInstance(), but in
fact it is just a detail of the core routing aspect
handling. In those cases, DI / makeInstance() can be used
directly. We drop both classes to avoid confusion. Note
this also makes AspectFactory stateless.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Oli Bartsch +1
    • Oliver Klee +1
    • Benni Mack +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Oli Bartsch +1
    • Oliver Klee +1
    • Benni Mack +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 1

Files 29

Show 9 more files

Review log 1117

  1. Christian Kuhn uploaded patch set 1 12/09/23, 18:13

  2. core-ci voted on patch set 1 V +1 12/09/23, 18:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50532

  3. Christian Kuhn rebased onto patch set 2 V +1 12/09/23, 19:04

  4. core-ci voted on patch set 2 V +1 12/09/23, 19:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50533

  5. Christian Kuhn uploaded patch set 3 V +1 12/10/23, 07:20

  6. core-ci voted on patch set 3 V +1 12/10/23, 07:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50543

  7. Christian Kuhn uploaded patch set 4 V +1 12/14/23, 11:12

  8. Christian Kuhn updated the commit message in patch set 5 12/14/23, 11:16

  9. core-ci voted on patch set 4 V +1 12/14/23, 11:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50650

  10. core-ci voted on patch set 5 V -1 12/14/23, 11:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50651

  11. core-ci voted on patch set 5 V +1 12/14/23, 12:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50651

  12. Oliver Klee voted on patch set 5 CR +1 V +1 12/14/23, 12:14

  13. Simon Schaufelberger voted on patch set 5 CR +1 V +1 12/15/23, 07:52

  14. Benni Mack voted on patch set 5 CR +1 V +1 12/15/23, 08:00

  15. Oli Bartsch commented on patch set 5 CR +1 V +1 12/15/23, 08:11

    Context.php:126

    What do you think about making this fluent?
  16. Christian Kuhn commented on patch set 5 CR +2 V +2 12/18/23, 10:52

    Context.php:126 Reply

    unsure. there is not *that* much need for it - setting up context is mainly a core thing in the first place. not with this patch anyways.
  17. Christian Kuhn merged patch set 6 12/18/23, 10:52