Skip to content

Commit

Permalink
Merge pull request #405 from derrabus/bugfix/deprecation-message
Browse files Browse the repository at this point in the history
Improve deprecation message for Criteria::orderBy()
  • Loading branch information
SenseException committed Mar 5, 2024
2 parents c13b813 + aed9ea8 commit 420480f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Criteria.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,9 @@ public function orderings(): array
*/
public function orderBy(array $orderings)
{
$method = __METHOD__;
$this->orderings = array_map(
static function (string|Order $ordering): Order {
static function (string|Order $ordering) use ($method): Order {
if ($ordering instanceof Order) {
return $ordering;
}
Expand All @@ -211,7 +212,7 @@ static function (string|Order $ordering): Order {
'doctrine/collections',
'https://github.com/doctrine/collections/pull/389',
'Passing non-Order enum values to %s() is deprecated. Pass Order enum values instead.',
__METHOD__,
$method,
);
}

Expand Down

0 comments on commit 420480f

Please sign in to comment.