Intervention / image

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

Add ImageManager interface #1336

Closed adamaveray closed 2 months ago

adamaveray commented 2 months ago

In v3 the ImageManager class is now final making it impossible to mock out in tests, and while most other classes in this library have corresponding interfaces enabling mocking this class does not.

This PR adds a new ImageManagerInterface interface with the 4 public instance methods from ImageManager. I've based it off how the Image & ImageInterface pair is set up, so the docblock contents for those methods have also been moved to the interface.

Addresses #1324.

olivervogel commented 2 months ago

Thank you, I think this can be adopted as is.