Skip to content

Commit 847d30e

Browse files
support for php 8
1 parent d1bae6d commit 847d30e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/AutoReps.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ private function addRep($k_bitrate, $width, $height): Representation
176176
private function sortReps(array &$reps): void
177177
{
178178
usort($reps, function (Representation $rep1, Representation $rep2) {
179-
$ascending = $rep1->getKiloBitrate() > $rep2->getKiloBitrate();
180-
return $this->sort ? $ascending : !$ascending;
179+
$ascending = $rep1->getKiloBitrate() - $rep2->getKiloBitrate();
180+
return $this->sort ? $ascending : -($ascending);
181181
});
182182
}
183183

@@ -239,4 +239,4 @@ public function getIterator()
239239

240240
return new \ArrayIterator($reps);
241241
}
242-
}
242+
}

0 commit comments

Comments
 (0)