Closed zeliard91 closed 8 years ago
Globally :+1: for the PR but the BC breaking needs to be handled.
Indeed @Soullivaneuh, I did not thought of BCs, any idea how it could be handled ?
Something like that is BC safe but the purpose of not injecting the kernel is forgotten no ?
public function __construct($cacheDirectory, $cacheDirMode, $handlerClass, ContainerInterface $container, KernelInterface $kernel, $throwException, $fallbackImage)
{
// ...
$this->fileLocator = $container->get('file_locator');
}
First one, the container have nothing to do here and this ugly things should be removed. (cc @Gregwar :-P).
So no, don't use the container.
What to do:
KernelInterface
is passed
There is no need to inject Kernel in ImageHandling as there is a service to locate resources.