New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AdminBundle] Mark classes internal/final #8453
Conversation
bundles/AdminBundle/Controller/Admin/Document/PageController.php
Outdated
Show resolved
Hide resolved
bundles/AdminBundle/Controller/Admin/Document/PrintpageControllerBase.php
Outdated
Show resolved
Hide resolved
bundles/AdminBundle/Controller/Reports/CustomReportController.php
Outdated
Show resolved
Hide resolved
bundles/AdminBundle/Controller/Reports/ReportsControllerBase.php
Outdated
Show resolved
Hide resolved
bundles/AdminBundle/EventListener/CustomAdminEntryPointCheckListener.php
Outdated
Show resolved
Hide resolved
Co-authored-by: Bernhard Rusch <brusch@users.noreply.github.com>
* [AdminBundle] Admin Controllers declared as final and marked @internal - pimcore#7189 * [AdminBundle] Admin Event Listeners declared as final and marked @internal - pimcore#7189 * [AdminBundle] Mark Admin Helpers @internal - pimcore#7189 * [AdminBundle] Security handlers declared final and classes marked @internal - pimcore#7189 * [AdminBundle] Mark Admin classes @internal - pimcore#7189 * [AdminBundle] Mark Admin classes internal - docs pimcore#7189 * [AdminBundle] Mark DI & bundle class internal and declare as final pimcore#7189 * Apply suggestions from code review Co-authored-by: Bernhard Rusch <brusch@users.noreply.github.com> Co-authored-by: Bernhard Rusch <brusch@users.noreply.github.com>
What's the reason for all classes to be marked as final? |
@roland4432 Because they are not intended to be overridden or customized. The BC promise / SemVer doesn't apply to those classes. |
Could you maybe leave that decission to the programmer? And.. it doesn't even have the desired effect, since you can still override the controller just not extend it. services:
Pimcore\Bundle\AdminBundle\Controller\Admin\IndexController:
class: AppBundle\Controller\Admin\IndexController and the controller is replaced... |
I am interested in what top contributors like @BlackbitNeueMedien @dpfaffenbauer @jdreesen think about that... |
I never understood the argument to make classes final. Arguments like
are simply not true. If you want to protect internal state of properties, then it is fine for me to make them private. But to prohibit extending a class will only lead to a lot of copy-paste. There are a lot of use-cases where reusing / extending the AdminBundle controllers will on the one hand make custom features easier to implement and on the other hand make them easier to migrate. Because what will happen is that all the custom features which currently extend the AdminBundle controllers which @roland4432 mentions will have to copy the methods from the original classes to still work. Then this at first will work but when those AdminBundle classes get changed, the copied methods might again not work. Of course now you will say that developers have to check their code anyway for Pimcore updates - but what is the advantage of making those classes final? |
For me it would be ok as well to just tag them as |
Would be totally fine with that. |
Changes in this pull request
Resolves partially #7189
Additional info