From 5b39b54f6a27addcd79c2c0ec16bc9a8aeaeba4d Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Tue, 2 Apr 2024 08:28:08 +0200 Subject: [PATCH] fix: `doctrine/collections` deprecations --- src/Operation/Matching.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Operation/Matching.php b/src/Operation/Matching.php index 70fb00d5..38f57541 100644 --- a/src/Operation/Matching.php +++ b/src/Operation/Matching.php @@ -7,6 +7,7 @@ use Closure; use Doctrine\Common\Collections\Criteria; use Doctrine\Common\Collections\Expr\ClosureExpressionVisitor; +use Doctrine\Common\Collections\Order; use Generator; use loophp\collection\Contract\Operation\Sortable; @@ -37,13 +38,13 @@ static function (Criteria $criteria): Closure { $pipes[] = (new Filter())()($filterCallback); } - $orderings = $criteria->getOrderings(); + $orderings = $criteria->orderings(); if ([] !== $orderings) { $next = null; foreach (array_reverse($orderings) as $field => $ordering) { - $next = ClosureExpressionVisitor::sortByField($field, Criteria::DESC === $ordering ? -1 : 1, $next); + $next = ClosureExpressionVisitor::sortByField($field, Order::Descending === $ordering ? -1 : 1, $next); } $pipes[] = (new Sort())()(Sortable::BY_VALUES)($next);