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

    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 1

Files 29

Show 9 more files