The expression return imagecreatefrompng($filename) could return the type resource which is incompatible with the type-hinted return GdImage. Consider adding an additional type-check to rule them out.
Loading history...
14
}
15
16
1
public function save(GdImage $resource, string $filename, int $compression = 100): void