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

PHP 8.4 triggers deprecation notice for implicit nullable parameter $downgradeProtection #15

Open
edhelas opened this issue Jan 6, 2025 · 3 comments
Labels

Comments

@edhelas
Copy link

edhelas commented Jan 6, 2025

It seems that you missed a nullable parameter declaration to pass PHP 8.4 support :)

Fabiang\Sasl\Options::__construct(): Implicitly marking parameter $downgradeProtection as nullable is deprecated, the explicit nullable type must be used instead in vendor/fabiang/sasl/src/Options.php (line 99)

@fabiang
Copy link
Owner

fabiang commented Jan 6, 2025

Hi,

I'm a bit confused by your issue. Should not only the following be a problem?

    public function __construct(
        ...
        DowngradeProtectionOptions $downgradeProtection = null
    ) {

And the fix would be:

    public function __construct(
        ...
        ?DowngradeProtectionOptions $downgradeProtection = null
    ) {

All your other examples shouldn't trigger the notice, since we don't have types declared there.

@edhelas
Copy link
Author

edhelas commented Jan 6, 2025

Yes sorry, I overlooked. My bad :)

Might be interesting to add typing for those parameters though, to have a code a bit more restrictive.

@fabiang
Copy link
Owner

fabiang commented Jan 7, 2025

Adding nullable types would unfortunately require dropping support for PHP versions older than 7.1. One of the initial goals of this library was to maintain compatibility with PHP 5.3 and later, allowing older software to still receive security updates. However, PHP 5.3 reached its end of life (EOL) 10 years ago, back in 2014.

Over all these years, no security issues have been reported for this library or for Auth_SASL2. Still, maintaining compatibility with such outdated PHP versions has become increasingly challenging.

I believe the time has come to move forward and modernize this library. I’ll create a ticket for this task and tackle it whenever I find the time. I’ll also make some edits to your issue to clarify the initial problem a bit.

Edit: btw thank you for pointing this out.

@fabiang fabiang changed the title Complete PHP 8.4 support PHP 8.4 triggers deprecation notice for implicit nullable parameter $downgradeProtection Jan 7, 2025
@fabiang fabiang added the bug label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants