public function writeTo($filename)
    {
        parent::writeTo($filename);
        
        if ($this->optimiserService instanceof ImageOptimiserInterface) {
            $this->optimiserService->optimiseImage($filename);
        }
    }
public function writeTo($filename)
    {
        parent::writeTo($filename);
        
        if ($this->optimiserService instanceof ImageOptimiserInterface) {
            $this->optimiserService->optimiseImage($filename);
        }
    }
public function writeTo ( $ filename ) { parent :: writeTo ( $ filename ) ; if ( $ this -> optimiserService instanceof ImageOptimiserInterface ) { $ this -> optimiserService -> optimiseImage ( $ filename ) ; } }
Calls the original writeTo function and then after that completes optimises the image
@param string $filename
Calls the original writeTo function and then after that completes optimises the image