Problem/Motivation
PHP 8.4 has been released, and this module is triggering a "use explicit nullable type" deprecation.
This is part of Drupal's coding standards now, but since the issues to fix phpcs in this module have stalled, I'm opening up this issue to fix this single deprecation to avoid the warnings on PHP 8.4.
After updating to PHP 8.4:
FILE: /src/Plugin/Action/UnpublishByKeywordComment.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
123 | 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: $account.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: /src/Plugin/Action/AssignOwnerNode.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
139 | 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: $account.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: /src/Plugin/Action/UnpublishByKeywordNode.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
73 | 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: $account.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: /tests/action_form_ajax_test/src/Plugin/Action/ActionAjaxTest.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
34 | 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: $account.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Comments
Comment #3
enchufeComment #4
andypostNot sure we need to make
action_idtyped only in one place but it's not requiredComment #5
enchufeYou are right, even though it is not an explicit PHP 8.4 warning I thought it would be a good contribution.
I have removed the variable typing and defined in
@docsthat this is amixedtype.Comment #6
andypostGoing to merge soon, would be great to fix phpstan/phpcs before making release
Comment #8
andypostFixed pipeline and merged, thank you
Comment #9
andypostfiled follow-up