- Issue created by @babidar
The Layout Paragraphs module is generating a PHP deprecation warning in drupal 11.2.2:
Deprecated: Drupal\layout_paragraphs\Utility\Dialog::dialogSettings(): Implicitly marking parameter $layout as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/app/web/modules/contrib/layout_paragraphs/src/Utility/Dialog.php on line 62
This occurs because the dialogSettings() method has a parameter with a default value of NULL but doesn't explicitly declare the parameter as nullable using the modern PHP syntax.
Install Layout Paragraphs module on a Drupal site running on drupal 11.2.2
Enable PHP error reporting or check error logs
Use any Layout Paragraphs functionality that calls the Dialog::dialogSettings() method
Observe the deprecation warning in logs or on screen
Update the method signature in src/Utility/Dialog.php line 62 to explicitly declare the parameter as nullable:
Current code:
public static function dialogSettings(LayoutParagraphsLayout $layout = NULL)
Fixed code:
public static function dialogSettings(?LayoutParagraphsLayout $layout = NULL)
Needs review
2.1
Code