Problem/Motivation

Under PHP 8.4 the module triggers deprecation notices:

Deprecated: Drupal\bigbluebutton\Form\BBBDeleteRecordingForm::__construct(): Implicitly marking parameter $settings as nullable is deprecated, the explicit nullable type must be used instead
Deprecated: Drupal\bigbluebutton\Form\BBBDownloadRecordingForm::__construct(): Implicitly marking parameter $settings as nullable is deprecated, the explicit nullable type must be used instead

PHP 8.4 deprecates implicitly nullable parameter types. A parameter declared as array $settings = null is implicitly nullable and must be written as ?array $settings = null.

See https://www.php.net/manual/en/migration84.deprecated.php

Steps to reproduce

  1. Run the site on PHP 8.4 with error_reporting including E_DEPRECATED.
  2. Render a field using the BigBlueButton recordings formatter, which builds the delete and download forms.

The notices are emitted at compile time, so php -l on either form class also reproduces them without a request.

Proposed resolution

Declare both constructor parameters explicitly nullable:

  • src/Form/BBBDeleteRecordingForm.php
  • src/Form/BBBDownloadRecordingForm.php
-  public function __construct(array $settings = null) {
+  public function __construct(?array $settings = null) {

This is a signature-compatible change: the parameter already accepted null. No behaviour changes.

Remaining tasks

  • Review and commit.
Command icon 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

daniel.pernold created an issue.

  • globexplorer committed 2bbc5488 on 1.0.x
    fix: #3615000 Implicitly marking parameter $settings as nullable is...