"Gesdinet\JWTRefreshTokenBundle\Entity\AbstractRefreshToken" class is deprecated
API Platform version(s) affected: 2.6.8
Description
Not sure if this is a API Platform issue or a JWTRefreshTokenBundle one.
When looking at the profiler there is a deprecation notice stating that:
Since gesdinet/jwt-refresh-token-bundle 1.0: The "Gesdinet\JWTRefreshTokenBundle\Entity\AbstractRefreshToken" class is deprecated, use "Gesdinet\JWTRefreshTokenBundle\Model\AbstractRefreshToken" instead.
{▼ /srv/api/vendor/gesdinet/jwt-refresh-token-bundle/Entity/AbstractRefreshToken.php:16 {▶} /srv/api/vendor/api-platform/core/src/Util/ReflectionClassRecursiveIterator.php:49 {▼ › try { › require_once $sourceFile; › } catch (\Throwable $t) { arguments: {▶} } }
How to reproduce
Install & configure API Platform 2.6.8
Install & configure the gesdinet/jwt-refresh-token-bundle bundle (v1.1.1) as described in the README (https://github.com/markitosgv/JWTRefreshTokenBundle)
For the record, I use Doctrine ORM & Symfony 5.4.
Load the /docs path (for example) and then look at the deprecation notices in the profiler.
I have fork the platform repo, then added & configured the bundle, you can find the fork here:
https://github.com/leup/api-platform-abstractrefreshtoken-deprecated
Possible Solution
Not sure how to solve this. I tried to follow the trace with xdebug but I am not sure how this Reflection thing works. It searches for an Entity while here the Entity has been replaced by a Model instead.
Possible solution is to wait for the bundle to delete the Entity as the file will not be loaded anymore by the Reflection Class.
https://github.com/markitosgv/JWTRefreshTokenBundle/issues/301#issuecomment-1111244982