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.
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.
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