Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: An argument $reverse of method \PhpImap\Imap::sort() has type boolean from PHP version 8 only #659

Merged
merged 3 commits into from
Feb 17, 2022

Conversation

alebedev80
Copy link
Contributor

@alebedev80 alebedev80 commented Feb 7, 2022

Environment (please complete the following information):

  • PHP IMAP version: 7.4.27
  • PHP Version: 7.4.27
  • Type of execution: CLI

Describe the bug

The $reverse variable type conversion from boolean to integer has been removed in this commit, but imap_open() before PHP version 8 only accepts integer type. Thus, in PHP 7 this code ends with the error:

imap_sort() expects parameter 3 to be int, bool given at /var/www/virtual/site/htdocs/vendor/php-imap/php-imap/src/PhpImap/Imap.php:934

Also i found strange assignment in \PhpImap\Imap::sort():

        /** @var int */
        $criteria = $criteria;

I've added PHP version detection and removed legacy code.

Please review it.

Thank you!

@alebedev80 alebedev80 changed the title BUG: And argument $reverse of method \PhpImap\Imap::sort() has type boolean from PHP version 8 only BUG: An argument $reverse of method \PhpImap\Imap::sort() has type boolean from PHP version 8 only Feb 7, 2022
@alebedev80
Copy link
Contributor Author

@barbushin @rmontagud @Theaxiom @hexathos @JellyBellyDev hey somebody please review and merge PR!

@mattyhansen
Copy link

mattyhansen commented Feb 15, 2022

@barbushin @rmontagud @Theaxiom @hexathos @JellyBellyDev @alebedev80

The following commit from 4.3.0 is causing this "imap_sort() expects parameter 3 to be int, bool given" error:

2cd5d0b

image

@alebedev80
Copy link
Contributor Author

@mattyhansen seems this repo abandoned
i plan to rid off it from my project

@JellyBellyDev
Copy link
Contributor

@alebedev80 sorry but I am not one of the maintainers, a long time ago I contributed a PR but I have no power over this repo.
good luck

@alebedev80
Copy link
Contributor Author

@Sebi94nbg i've fixed a code, please review it again.

@Sebbo94BY Sebbo94BY merged commit f1e316b into barbushin:master Feb 17, 2022
@Sebbo94BY
Copy link
Collaborator

Released in version 4.5.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants