Injecting the container: a bad practice that you should avoid

The Dependency Injection pattern helps us achieve the Dependency Inversion Principle, and we often end up with a Container object that resolves our dependencies for us. But a lot of times, people inject the whole container instead of injecting the actual dependencies, and that's a really bad practice when it comes to Object-Oriented Design.

SOLID principles violations on Symfony's Cookbook: Custom Twig Extension

A cookbook is not intended to teach you how to cook: it guides you in preparing specific dishes according to a precise methodology. The issue is that people are learning the wrong way, and that pretty much defines the way web applications are being developed on top of the Symfony framework – and really any other frameworks as well.