Skip to content

Commit

Permalink
support for php 8
Browse files Browse the repository at this point in the history
  • Loading branch information
aminyazdanpanah committed Apr 27, 2021
1 parent d1bae6d commit 847d30e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/AutoReps.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ private function addRep($k_bitrate, $width, $height): Representation
private function sortReps(array &$reps): void
{
usort($reps, function (Representation $rep1, Representation $rep2) {
$ascending = $rep1->getKiloBitrate() > $rep2->getKiloBitrate();
return $this->sort ? $ascending : !$ascending;
$ascending = $rep1->getKiloBitrate() - $rep2->getKiloBitrate();
return $this->sort ? $ascending : -($ascending);
});
}

Expand Down Expand Up @@ -239,4 +239,4 @@ public function getIterator()

return new \ArrayIterator($reps);
}
}
}

0 comments on commit 847d30e

Please sign in to comment.