File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 1414use const IMAP_WRITETIMEOUT ;
1515use InvalidArgumentException ;
1616use const NIL ;
17+ use const PHP_MAJOR_VERSION ;
1718use PhpImap \Exceptions \ConnectionException ;
1819use const SE_FREE ;
1920use const SORTARRIVAL ;
@@ -911,11 +912,18 @@ public static function sort(
911912 \imap_errors (); // flush errors
912913
913914 $ imap_stream = self ::EnsureConnection ($ imap_stream , __METHOD__ , 1 );
914- $ reverse = $ reverse ;
915915
916916 /** @var int */
917917 $ criteria = $ criteria ;
918918
919+ if (PHP_MAJOR_VERSION < 8 ) {
920+ /** @var int */
921+ $ reverse = (int ) $ reverse ;
922+ } else {
923+ /** @var bool */
924+ $ reverse = $ reverse ;
925+ }
926+
919927 if (null !== $ search_criteria && null !== $ charset ) {
920928 $ result = \imap_sort (
921929 $ imap_stream ,
You can’t perform that action at this time.
0 commit comments