Strategy pattern in Symfony
In general, we use the Strategy Pattern when we can do something in several ways depending on some condition. Suppose we have to create some image resize class using GD library. We could create some code like this: class ImageResizer { public function resize(string $filename, string extension, int $newWidth, int $newHeight) ...