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/Form/GroupDeleteConfirm.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:
| | $paragraphs_browser_type.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: /src/Form/ParagraphTypeGroupsForm.php
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
79 | 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: $paragraphs_type.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: /src/Form/GroupEditForm.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
40 | 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:
| | $paragraphs_browser_type.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: /src/Form/ParagraphsBrowserForm.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
81 | 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: $file_url_generator.
112 | 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: $field_config.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Comments
Comment #3
koustav_mondal commentedComment #4
koustav_mondal commentedFixes were already there in previous commit, did minor changes. please review it and move to RTBC.
Comment #6
enchufeFixed
\Drupal\paragraphs_browser\Form\ParagraphsBrowserFormexplicit nullable types.Comment #7
enchufeComment #8
keopxIt works for me
Comment #9
anna d commentedMerge request !17 resolves the following deprecation warnings introduced after upgrading to PHP 8.4:
Deprecated: Drupal\paragraphs_browser\Form\GroupEditForm::buildForm(): Implicitly marking parameter $paragraphs_browser_type as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/paragraphs_browser/src/Form/GroupEditForm.php on line 40
PHP Deprecated: Drupal\paragraphs_browser\Form\GroupDeleteConfirm::buildForm(): Implicitly marking parameter $paragraphs_browser_type as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/paragraphs_browser/src/Form/GroupDeleteConfirm.php on line 34
Deprecated: Drupal\paragraphs_browser\Form\GroupDeleteConfirm::buildForm(): Implicitly marking parameter $paragraphs_browser_type as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/paragraphs_browser/src/Form/GroupDeleteConfirm.php on line 34
PHP Deprecated: Drupal\paragraphs_browser\Form\ParagraphTypeGroupsForm::buildForm(): Implicitly marking parameter $paragraphs_type as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/paragraphs_browser/src/Form/ParagraphTypeGroupsForm.php on line 79
Deprecated: Drupal\paragraphs_browser\Form\ParagraphTypeGroupsForm::buildForm(): Implicitly marking parameter $paragraphs_type as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/paragraphs_browser/src/Form/ParagraphTypeGroupsForm.php on line 79
PHP Deprecated: Drupal\webp\Controller\FileDownloadController::__construct(): Implicitly marking parameter $streamWrapperManager as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/webp/src/Controller/FileDownloadController.php on line 57
Comment #11
borisson_RTBC++, please commit this.
Comment #12
mauro_ commentedJust adding a stable patch link since there is no new version available yet
Comment #13
stijndmd commentedRTBC++, please commit this.
Comment #14
gregglesThanks for the work and the reviews. I've merged this for now, but don't plan to make a new stable release for a while (if ever). I hope folks who need this module will consider becoming a maintainer.