Skip to content

[BUG] PhpImap is not compatible with PHP8.4 #731

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

Open
genyslt opened this issue Mar 17, 2025 · 3 comments
Open

[BUG] PhpImap is not compatible with PHP8.4 #731

genyslt opened this issue Mar 17, 2025 · 3 comments
Labels
needs investigation This will be tested / debugged or checked out.

Comments

@genyslt
Copy link

genyslt commented Mar 17, 2025

Environment (please complete the following information):

  • PHP IMAP version: 5.0.1
  • PHP Version: 8.4.5

Describe the bug
PhpImap\Mailbox::__construct(): Implicitly marking parameter $attachmentsDir as nullable is deprecated, the explicit nullable type must be used instead

To Reproduce
PHPSTAN

The used code:

$mailbox =  new Mailbox(
			$connection_strin,
			$username,
			$password,
			$attachmentsDir
		);

PhpImap\Mailbox::__construct(): Implicitly marking parameter $attachmentsDir as nullable is deprecated, the explicit nullable type must be used instead

@genyslt genyslt added the needs investigation This will be tested / debugged or checked out. label Mar 17, 2025
@mirko-pagliai
Copy link

I get something very similar:

deprecated: 8192 :: PhpImap\Exceptions\ConnectionException::__construct(): Implicitly marking parameter $previous as nullable is deprecated, the explicit nullable type must be used instead on line 16 of /home/mirko/Server/climat/vendor/php-imap/php-imap/src/PhpImap/Exceptions/ConnectionException.php

In summary, it seems to me that with php 8.4 arguments that accept null must be explicitly marked as nullable.

For example:

public function __construct(array $message, int $code = 0, Exception $previous = null)

shoud be:

public function __construct(array $message, int $code = 0, ?Exception $previous = null)

And for all similar cases.

@mirko-pagliai
Copy link

Hi, is there anyone who is carrying on the development?

@mirko-pagliai
Copy link

See #722 there's already a pull request for a while

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation This will be tested / debugged or checked out.
Projects
None yet
Development

No branches or pull requests

2 participants