Skip to content

PHP 8.4 Deprecated Warning: Implicitly nullable parameter $previous in PhpfastcacheIOException::__construct #926

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

Closed
1 task done
CHANCENY opened this issue Apr 9, 2025 · 3 comments
Assignees

Comments

@CHANCENY
Copy link

CHANCENY commented Apr 9, 2025

Which extension is this issue about ?

Couchbasev4

What type of issue is this?

Incompatibility (be specific)

Operating system + version

windows 11

PHP version

8.4

Connector/Database version (if applicable)

Files (Core)

Extension version (NOT THE PHPFASTCACHE VERSION)

v6

Phpfastcache version

9.2

Describe the issue you're facing

Hi team,

I'm using the latest version of phpfastcache/phpfastcache with PHP 8.4, and I'm encountering a deprecation warning due to an implicitly nullable parameter in the constructor of PhpfastcacheIOException.

PHP Version: 8.4

Phpfastcache version: Latest (^9.x)

OS: [Windows 11]

Composer version: version 2.8.6

Expected behavior

no warning: Deprecated: Phpfastcache\Exceptions\PhpfastcacheIOException::__construct(): Implicitly marking parameter $previous as nullable is deprecated, the explicit nullable type must be used instead

Code sample (optional)

public function __construct(string $message = "", int $code = 0, \Throwable $previous = null)
{
$lastError = error_get_last();
if ($lastError) {
$message .= "\n";
$message .= "Additional information provided by error_get_last():\n";
$message .= "{$lastError['message']} in {$lastError['file']} line {$lastError['line']}";
}
parent::__construct($message, $code, $previous);
}

Suggestion to fix the issue (optional)

public function __construct(string $message = "", int $code = 0, ?\Throwable $previous = null)

References (optional)

No response

Do you have anything more you want to share? (optional)

No response

Have you searched in our Wiki before posting ?

  • I have searched over the Wiki
Copy link

github-actions bot commented Apr 9, 2025

Hello curious contributor !
Since it seems to be your first contribution, make sure that you've been:

  • Reading and searching out our WIKI
  • Reading and agreed with our Code Of Conduct
  • Reading and understood our Coding Guideline
  • Reading our README
    If everything looks unclear to you, tell us what 😄
    The Phpfastcache Team

@Naasi
Copy link

Naasi commented Apr 29, 2025

Same error here. Important to FIX please!

@khoaofgod
Copy link
Member

#927

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

No branches or pull requests

4 participants