If a class MaintenanceModeDecorator implements the MaintenanceModeInterface interface, it must implement all methods of the interface.
I also want to ask why you used the class_resolver service instead of just creating an alter form hook?

Comments

taraskorpach created an issue. See original summary.

nicoloye’s picture

Reviewing this issue as part of the Contribution Weekend 2023

nicoloye’s picture

Status: Needs review » Fixed

Thanks for the good catch, I changed your implementation a little, if we have to declare the function we also need to call the decorated service to be sure the functionality is preserved.

As for the class_resolver it's a pattern that allow to keep an object oriented architecture rather than procedural code. It helps having a better organization and quality of the code. If you want other examples you can check the workspaces core module for example.

taraskorpach’s picture

Assigned: taraskorpach » Unassigned

Thank you very much for your response and for taking my small fix into account!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.