Problem/Motivation
When running on PHP 8.4, implicitly marking parameters as nullable (e.g. array &$options = NULL) is deprecated. Rebuilding the cache triggers the following deprecation warning:
Deprecated function: Drupal\contextual_range_filter\Plugin\views\argument\DateRange::init(): Implicitly marking parameter $options as nullable is deprecated, the explicit nullable type must be used instead in include() (line 576 of /var/www/html/vendor/composer/ClassLoader.php).
Steps to reproduce
- Install and activate the module on a site running PHP 8.4.
- Rebuild the cache.
- Observe the deprecation warning.
Proposed resolution
Update DateRange::init() parameter signature to explicitly declare the type as nullable: ?array &$options = NULL, matching the upstream \Drupal\views\Plugin\views\argument\Formula::init() signature in Drupal core.
Remaining tasks
- Maintainer review
User interface changes
None
Introduced terminology
None
API changes
None
Data model changes
None
Release notes snippet
N/A
Issue fork contextual_range_filter-3641180
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 #4
keerthi kumar commentedI would like to work on this!
Comment #5
keerthi kumar commentedOpened MR updating `DateRange::init()` to explicitly type `$options` as nullable (`?array &$options = NULL`) for PHP 8.4 compatibility, matching Drupal core. Moving to Needs review.