We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ce19d61 commit f1e316bCopy full SHA for f1e316b
src/PhpImap/Imap.php
@@ -14,6 +14,7 @@
14
use const IMAP_WRITETIMEOUT;
15
use InvalidArgumentException;
16
use const NIL;
17
+use const PHP_MAJOR_VERSION;
18
use PhpImap\Exceptions\ConnectionException;
19
use const SE_FREE;
20
use const SORTARRIVAL;
@@ -911,11 +912,18 @@ public static function sort(
911
912
\imap_errors(); // flush errors
913
914
$imap_stream = self::EnsureConnection($imap_stream, __METHOD__, 1);
- $reverse = $reverse;
915
916
/** @var int */
917
$criteria = $criteria;
918
919
+ if (PHP_MAJOR_VERSION < 8) {
920
+ /** @var int */
921
+ $reverse = (int) $reverse;
922
+ } else {
923
+ /** @var bool */
924
+ $reverse = $reverse;
925
+ }
926
+
927
if (null !== $search_criteria && null !== $charset) {
928
$result = \imap_sort(
929
$imap_stream,
0 commit comments