You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to update an older Kunstmaan CMS site to Symfony 5.
There are a lot of controllers in the project that extend the Kunstmaan Controller classes.
I'm finding that many of them are now final
This is making my upgrade process incredibly frustrating.
What is the benefit of these classes being final? This is a big BC break for me.
I'm having to copy and paste code out of the kunstmaan classes into user land controllers.
e.g.: final class SettingsController extends AbstractController
The text was updated successfully, but these errors were encountered:
Hi @henrypenny, sorry for the late answer! Regarding the final classes, this is a decision made to ease the maintainability of the code. In the past all classes where open to extension or had public properties/methods anyone could use and this made it hard to do required refactorings to improve our code base or add compatibility for newer symfony versions without breaking backwards compatibility.
That's why we decided to mark certain classes as final to allows us to make changes easier in the future. Those controllers have been marked with @final in the 5.x versions, thus triggering a symfony deprecation when you extend from these classes. So no BC break in theory. I ofcourse understand this might make some implementations difficult and ideally the controller logic is moved to a service, so that the controller just passed the request to a service and it returns a response. This way users of the cms can implement their own logic via a custom service.
Can you share some use cases where you have issues with now? Let's review those cases and find a solution that works for everbody!
I'm trying to update an older Kunstmaan CMS site to Symfony 5.
There are a lot of controllers in the project that extend the Kunstmaan Controller classes.
I'm finding that many of them are now
final
This is making my upgrade process incredibly frustrating.
What is the benefit of these classes being final? This is a big BC break for me.
I'm having to copy and paste code out of the kunstmaan classes into user land controllers.
e.g.:
final class SettingsController extends AbstractController
The text was updated successfully, but these errors were encountered: