Problem/Motivation
PHP 8.4 deprecates implicitly nullable parameters. When a parameter has a typed declaration (e.g., array) but has NULL as its default value, PHP 8.4 emits a deprecation warning. In this case:
Deprecated: Drupal\views_selective_filters\Plugin\views\filter\Selective::init(): Implicitly marking parameter $options as nullable is deprecated, the explicit nullable type must be used instead in /web/modules/contrib/views_selective_filters/src/Plugin/views/filter/Selective.php on line 39
Steps to reproduce
- Be in a PHP 8.4 environment
- Create a view
- Attempt to add a selective filter to the view
Proposed resolution
Add an explicit nullable type declaration to the affected parameter.
Comments
Comment #3
benjy44Hi,
Applying patch from MR !15 resolves warning after upgrading to PHP 8.4.
Tested on Drupal core 10.6 views_selective_filters 2.0.0-alpha2 PHP 8.4
Comment #4
littlecodingConfirming that this patch is working with PHP 8.4 and core 11.2.10