Open johanadivare opened 2 weeks ago
Thanks for reporting! Fix you suggest would be great 👍
Not sure its a good idea: as I remember, in issue https://github.com/rectorphp/rector-doctrine/issues/315, it was discussed that, maybe:
Criteria::orderBy
But any help for improving this is welcome :smile_cat:
@julienfastre Would it fix this bug? 🙏
I'll try to find some time next week or the week after, @TomasVotruba .
When i use
DOCTRINE_COLLECTION_22
it will replace myDoctrine\\Common\\Collections\\Criteria::DESC
to Doctrine\Common\Collections\Order::DESCbut this causes the following error:
TypeError: Doctrine\ORM\QueryBuilder::orderBy(): Argument #2 ($order) must be of type ?string, Doctrine\Common\Collections\Order given, called in /srv/Repository/BlogRepository.php on line 103`The replacement should actually be
Doctrine\\Common\\Collections\\Order::DESC->value
@julienfastre asked if this would maybe cause problems see: https://github.com/rectorphp/rector-doctrine/pull/297#issuecomment-1983489234I think we should replace with the
->value
call?