 <p>Thanks to the help of @RenatoMendesFigueiredo, @hasumedic &amp; (the most part) @Cerad, without need of premium plan, I can see the point of this warning and figure it out.</p> <p>In fact, a long time ago, I would make my service extending the <a href="http://api.symfony.com/3.0/Symfony/Component/DependencyInjection/ContainerAware.html" rel="nofollow noreferrer"><code>ContainerAware</code></a> rather than write the method directly, but forced to live with its limits (the service could not have extended another class). </p> <p>In 2.4, the <a href="http://api.symfony.com/3.0/Symfony/Component/DependencyInjection/ContainerAwareTrait.html" rel="nofollow noreferrer"><code>ContainerAwareTrait</code></a> was added. </p> <p>My guess is that the warning has been added in the same time as this trait, because :</p> <p>1) No reason to write a setter or a constructor to inject the container if a trait that do it already exists.</p> <p>2) No need of pass the container as an argument in an another goal than inject it to a service.</p> <p>Also, I removed the <code>setContainer</code> method from the class of my service, make it use the <code>ContainerAwareTrait</code> and keep the the service definition as before.</p> <p><em>And ...</em></p> <p><a href="https://i.stack.imgur.com/RKt0e.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RKt0e.png" alt="Kudos"></a></p> <p><strong>Kudos</strong>!</p>