- Issue created by @AndyF
- 🇷🇺Russia Chi
The Twig Tweak services are part of public API which means their signature and behavior will not change withing till the next major release. However, in 4.x they will be final, you won't be able to extend them. That work is in progress.
As of interfaces, I don't think it is needed. The primary use of interfaces is defining an abstraction, so the services can be easily swapped with different implementation. Twig Tweak services are only used in various Twig functions and filters. And it much easy to just replace those functions and filters using alter hook than swapping inner service. - 🇬🇧United Kingdom AndyF
Beautiful, thanks for the confirmation!
The primary use of interfaces is defining an abstraction, so the services can be easily swapped with different implementation.
Right you are (: I think I misread the lack of interfaces as a signal that they might not be public, no point bloating things unnecessarily, thanks again!
- 🇬🇧United Kingdom AndyF
Although just idly thinking out loud, if there's no anticipation of swapping out services via the container, does it make sense not to have them as services at all and just use the class resolver? Not sure you win much, feels a bit like navel-gazing, but popped into my head (:
- 🇷🇺Russia Chi
Using the service container seems more continent for injecting dependencies and testing.