Intervention / image

PHP Image Processing
https://image.intervention.io
MIT License
13.84k stars 1.5k forks source link

Fix ImageInterface encode() method argument #1286

Closed edgarsn closed 7 months ago

edgarsn commented 7 months ago

ImageInterface encode argument is not aligned with Image class.

ImageInterface.php

public function encode(EncoderInterface $encoder): EncodedImageInterface;

Image.php

public function encode(EncoderInterface $encoder = new AutoEncoder()): EncodedImageInterface

This is causing static analysis tools to fail as well as confuse IDEs with error:

Method Intervention\Image\Interfaces\ImageInterface::encode() invoked with 0 parameters, 1 required.

olivervogel commented 7 months ago

Thank you.