core
core copied to clipboard
Missing interface after minor upgrade
API Platform version(s) affected: x.y.z I am on version 2.6.8
Description
The interface ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface
was present in 2.6.8
but hard moved in 2.7.0
to ApiPlatform\Doctrine\Orm\Util\QueryNameGeneratorInterface
.
It is easy to fix, but it looks like a BC break to me. The interface was not experimental or internal.
Checking the CHANGELOG, the Core
namespace was removed in 3.0 beta 🤔 not in 2.7.0
How to reproduce
Possible Solution
Add it back with a deprecation
Additional Context
it is aliased and deprecated: https://github.com/api-platform/core/blob/2.7/src/deprecated_interfaces.php#L37
Hi @soyuka & @OskarStark ,
The service is aliased, but I think @OskarStark implements a class with this interface.
Are you using autowiring and we forgot an alias?
Facing the same issue after 2.7.0 migration
The service is aliased, but I think @OskarStark implements a class with this interface.
Exactly and it does not have the "hack" like other classes with the class_exists
wrapper
Similar happened to me for this interface:
ApiPlatform\Core\Api\UrlGeneratorInterface
which was hard moved in 2.7 to
ApiPlatform\Api\UrlGeneratorInterface
Yes same for me in another project
The ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface
is used inside the ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\FilterInterface
and throughout all classes using the FilterInterface. Since it was moved, these are now importing an undefined class. Although that might "work" because of aliasing, you will get an error from your IDE, e.g. when implementing a custom filter.
So adding it back with a deprecation, as @OskarStark already pointed out, should fix this issue.
we don't cover ide errors sorry
These interfaces are aliased and we kept a bc-layer in 2.7. If you've a PHP error please let me know.