Final Classes without Interfaces
If a class is marked as final, it should have an Interface.
Why? PHPUnit Tests. In Unit Tests I never want to use new $something(); unless its the class I want to test. EasyAdmin does not allow me to inject some classes by Interface reference.
See #5299 and https://github.com/EasyCorp/easyadmin-no-final-plugin
I see, interesting, thats not however really what I am suggesting.
Instead, there should be Interfaces. Just imagine you inject a dependency that is final and you want to write a PHPUnit test for that class. You cannot - at least not with some ugly hacks that you should avoid.
Having interfaces at hand allow for simple injection of anything without having to remove final.
+1 here, I'm +1 to disallow inheritance, keep it final but composition is key of OOP, so need to provide an interface so that I could decorate it
@oleg-andreyev I am working on PRs to introduce more and more interfaces. You can review this open PR to support me on the matter. :+1: https://github.com/EasyCorp/EasyAdminBundle/pull/5996
@oleg-andreyev, I don't think I can decorate fields which is what I need to extend/modify.