Skip to content

Commit

Permalink
Simplify if-else blocks in code
Browse files Browse the repository at this point in the history
  • Loading branch information
SenseException committed May 30, 2024
1 parent e043188 commit f95957c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,7 @@ public function omitKeys(): self
public function getSorter(): Sorter
{
$comparator = $this->getComparator();
if ($this->isKeySort) {
$sorter = new Key($comparator);
} else {
$sorter = new Asc($comparator);
}
$sorter = $this->isKeySort ? new Key($comparator) : new Asc($comparator);

if (! $this->isAsc) {
$sorter = new Desc($sorter);
Expand Down

0 comments on commit f95957c

Please sign in to comment.