Problem/Motivation
There are a few issues with PHP 8.4, all of them related to the implicitly nullable parameter being deprecated now, requiring an explicit marking declaration.
I see the issue #3505552: Deprecated: Implicitly nullable in PHP 8.4 fixed a few, but a couple still remains, most specifically for the Context UI submodule.
Checking the code using PHPCompatibility code sniffer:
FILE: /var/www/html/web/modules/contrib/context/modules/context_ui/src/Form/ConditionDeleteForm.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
92 | WARNING | Implicitly marking a parameter as nullable is deprecated since PHP 8.4. Update the type to be explicitly nullable instead. Found implicitly nullable parameter: $context.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/html/web/modules/contrib/context/modules/context_ui/src/Form/ReactionDeleteForm.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
95 | WARNING | Implicitly marking a parameter as nullable is deprecated since PHP 8.4. Update the type to be explicitly nullable instead. Found implicitly nullable parameter: $context.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Time: 351ms; Memory: 8MB
exit status 1
Steps to reproduce
Test the code base with PHPCompatibility code sniffer.
Proposed resolution
Fix deprecations.
Remaining tasks
None.
User interface changes
None.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | context-fix-php-84-deprecations-3513516-62.patch | 1.45 KB | maursilveira |
Issue fork context-3513516
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
maursilveira commentedComment #4
maursilveira commentedI've created a merge request with the fixes for the PHP 8.4 deprecations.
I'm also attaching here a patch file for the same fixes, for composer patches.
Please let me know if you have any questions. Thank you.
Comment #5
deaom commentedIt seems gitlab-ci is not added for the 5.x-dev branch so pipelines are not running to see if changes actually break anything. The gitlab-ci was added in issue #3514532: fix phpstan warnings for the 5.x branch, so maybe best to merge that issue once RTBC so testing can happen for MRs. I'm setting this to RTBC as it seems nothing get broken by manually testing the context added on the site.
Comment #6
jaswinsingh commented+1 for Patch #4
Comment #7
jds1This is adding up in the logs – could we get a release tagged?
Comment #8
aitala commented+1 for a new release.
I was discouraged by a few folks on Slack about using this module. The comment was that it was abandoned..
Thanks,
Eric