Gregwar / ImageBundle

Image manipulation bundle for Symfony 2
MIT License
195 stars 50 forks source link

Replace kernel injection by FileLocator #86

Closed zeliard91 closed 8 years ago

zeliard91 commented 8 years ago

There is no need to inject Kernel in ImageHandling as there is a service to locate resources.

soullivaneuh commented 8 years ago

Globally :+1: for the PR but the BC breaking needs to be handled.

zeliard91 commented 8 years ago

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');
}
soullivaneuh commented 8 years ago

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: