-
Notifications
You must be signed in to change notification settings - Fork 492
Address implicit nullable parameter deprecation #163
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
Address implicit nullable parameter deprecation #163
Conversation
Implicit nullable parameter declarations are deprecated in PHP 8.4, so the following output appears when using SimpleXLSX with PHP 8.4: `Deprecated: Shuchkin\SimpleXLSXEx::getColorValue(): Implicitly marking parameter $a as nullable is deprecated, the explicit nullable type must be used instead in src/SimpleXLSXEx.php on line 614` This updates the type of the `getColorValue` function's `$a` parameter to be explicitly nullable.
|
@shuchkin Can you please merge this? It whould be very helpful. Thank you very much for your work |
|
Valentin, we support PHP 5.5+, "?Class $arg" supported from 7.1 |
|
@shuchkin Thank you for your attention on this. I tested 1.1.15 and unfortunately the implementation you mentioned leads to an error because other SimpleXLSX functions can pass null values to For the change in 1.1.15 to work without errors, it appears that you will need to account for null values before calling |
|
oops fixed |
|
Thanks! I confirmed that the affected example and my related scripts using @shuchkin For what it's worth, I would highly recommend against re-tagging a version that has already been published like this. In my experience, it's always better to fix forward by releasing a new version (e.g., 1.1.16), as it avoids potential downstream issues. It seems that Composer [2.9.2] may handle this situation properly but it's best not to rely on that (e.g., I manually modified my |
Implicit nullable parameter declarations are deprecated in PHP 8.4, so the following output appears when using SimpleXLSX with PHP 8.4:
Deprecated: Shuchkin\SimpleXLSXEx::getColorValue(): Implicitly marking parameter $a as nullable is deprecated, the explicit nullable type must be used instead in src/SimpleXLSXEx.php on line 614This updates the type of the
getColorValuefunction's$aparameter to beexplicitly nullable.
It's worth noting that nullable type declarations were introduced in PHP 7.1, so this is only a solution if your PHP target is at or above 7.1. [For what it's worth, PHP 7.1 has been unsupported (EOL) since 2019-12-01.]