CriteriaOrderingConstantsDeprecationRector

Replace ASC/DESC with enum Ordering in Criteria::orderBy method call, and remove usage of Criteria::ASC and Criteria::DESC constants elsewhere

 use Doctrine\Common\Collections\Criteria;

 $criteria = new Criteria();
-$criteria->orderBy(['someProperty' => 'ASC', 'anotherProperty' => 'DESC']);
+$criteria->orderBy(['someProperty' => \Doctrine\Common\Collections\Order::Ascending, 'anotherProperty' => \Doctrine\Common\Collections\Order::Descending]);

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\Doctrine\Collection22\Rector\CriteriaOrderingConstantsDeprecationRector;

return RectorConfig::configure()
    ->withRules([
        CriteriaOrderingConstantsDeprecationRector::class,
    ]);