Review main Abandoned Breaking

65653[!!!][TASK] Remove dependencies from ControllerContext

Alexander Schnitzler CR 0 V 0 Normal +85 −164 updated 12/11/20, 12:22

Commit message

This patch removes all dependencies (services) from the
ControllerContext class as that class is actually a
prototype that handles internal state. Also it used those
services only to provide helper methods that eased the
creation of flash message queues but hid the statefulness.

From now on, the controller context can no longer be asked
for a flash message queue with the right identifier
magically set in the background. The ActionController now
holds the default flash message identifier for the current
plugin call (request). An instance of the needed flash
message queue has to be created manually but it's possible
to do so in the ActionController context since the class
now has a dependency to the FlashMessageService.

Alternatively, the FlashMessageService can be injected via
DI in other locations if needed. Outside a controller the
flash message identifier can be built manually if needed
from the request which is still accessible through the
ControllerContext.

Another breaking change is the removal of the UriBuilder
getter from the ControllerContext. But since that was just
a shortcut to have the uri builder quickly available, it
has been removed as well for a good reason. The UriBuilder
is no service as it handles an internal state and should
not be shared. Whenever an uri has to be build a fresh
instance of the builder must be created instead.

Review

  • Code review CR 0

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V 0

    Imported before Forger kept the single votes, the next import adds them.

Files 18