Skip to content

Commit 30f62b6

Browse files
committed
changelog 6.2 branch
1 parent 7d5c28c commit 30f62b6

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

src/Symfony/Component/Finder/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
CHANGELOG
22
=========
33

4-
6.1
4+
6.2
55
---
66

77
* Add `Finder::sortByCaseName()` to sort by name with case insensitive sorting methods

src/Symfony/Component/Finder/Finder.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,8 +451,7 @@ public function sortByName(bool $useNaturalSort = false): static
451451
*/
452452
public function sortByCaseName(bool $useNaturalSort = false): static
453453
{
454-
$this->sort = $useNaturalSort ? Iterator\SortableIterator::SORT_BY_NAME_NATURAL_CASE_INSENSITIVE :
455-
Iterator\SortableIterator::SORT_BY_NAME_CASE_INSENSITIVE;
454+
$this->sort = $useNaturalSort ? Iterator\SortableIterator::SORT_BY_NAME_NATURAL_CASE_INSENSITIVE : Iterator\SortableIterator::SORT_BY_NAME_CASE_INSENSITIVE;
456455

457456
return $this;
458457
}

src/Symfony/Component/Finder/Iterator/SortableIterator.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ public function __construct(\Traversable $iterator, int|callable $sort, bool $re
8686
} elseif (self::SORT_BY_NONE === $sort) {
8787
$this->sort = $order;
8888
} elseif (\is_callable($sort)) {
89-
$this->sort = $reverseOrder ? static function (\SplFileInfo $a, \SplFileInfo $b) use ($sort) { return -$sort($a, $b); }
90-
: $sort(...);
89+
$this->sort = $reverseOrder ? static function (\SplFileInfo $a, \SplFileInfo $b) use ($sort) { return -$sort($a, $b); } : $sort(...);
9190
} else {
9291
throw new \InvalidArgumentException('The SortableIterator takes a PHP callable or a valid built-in sort algorithm as an argument.');
9392
}

0 commit comments

Comments
 (0)