sonata-project / SonataMediaBundle

Symfony SonataMediaBundle
https://docs.sonata-project.org/projects/SonataMediaBundle
MIT License
451 stars 495 forks source link

Add interface for format resizers #1861

Closed jordisala1991 closed 3 years ago

jordisala1991 commented 4 years ago

Feature Request

We are checking for the existance of a method on a class here:

https://github.com/sonata-project/SonataMediaBundle/blob/3.x/src/DependencyInjection/Compiler/ThumbnailCompilerPass.php#L35

The only class that implement that method is:

https://github.com/sonata-project/SonataMediaBundle/blob/3.x/src/Thumbnail/FormatThumbnail.php#L46

We should really add an interface with the method and check that instead (adding the corresponding BC layers). This issue becomes more problematic when trying to make this bundle compatible with php 8, because is_callable is not able to check with a string class name, but needs an object.

First saw in: https://github.com/sonata-project/SonataMediaBundle/pull/1859

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

jordisala1991 commented 3 years ago

Fixed on #2071