Problem/Motivation

There is a lot of "Deprecated: XXX(): Implicitly marking parameter $xxx as nullable is deprecated, the explicit nullable type must be used instead in xxx_file.php on line xxx" warnings after cache reset under Drupal 11 and php 8.4.

Proposed resolution

Use nullable types for such parameters. Available since PHP 7.1 so no worries about backwards compatibility.

Issue fork bootstrap-3528571

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

f1mishutka created an issue. See original summary.

f1mishutka changed the visibility of the branch 3528571-php-8.4-compatibility to hidden.

f1mishutka’s picture

Assigned: f1mishutka » Unassigned
Status: Active » Needs review
f1mishutka’s picture

Simple patch ready in merge request. Actually just a matter of php syntax, no functionality changed.

f1mishutka’s picture

Status: Needs review » Reviewed & tested by the community
joseph.olstad’s picture

Version: 8.x-3.35 » 8.x-3.x-dev
Status: Reviewed & tested by the community » Fixed

Merged into 8.x-3.x-dev

f1mishutka’s picture

Thanks!

hosterholz made their first commit to this issue’s fork.

hosterholz’s picture

Status: Fixed » Needs review

There are still nullable parameters and another deprecation

FILE: ...l/docroot/themes/contrib/bootstrap/src/Plugin/Provider/ProviderException.php
----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------
 29 | 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: $previous.
    |         | (PHPCompatibility.FunctionDeclarations.RemovedImplicitlyNullableParam.Deprecated)
----------------------------------------------------------------------------------


FILE: ...croot/themes/contrib/bootstrap/src/Plugin/Markdown/AllowedHtml/Bootstrap.php
----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------
 23 | 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: $activeTheme.
    |         | (PHPCompatibility.FunctionDeclarations.RemovedImplicitlyNullableParam.Deprecated)
----------------------------------------------------------------------------------


FILE: /var/www/html/docroot/themes/contrib/bootstrap/src/Utility/ArrayObject.php
----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------
 17 | WARNING | When the magic __serialize() and __unserialize() methods are
    |         | available and the code base does not need to support PHP < 7.4,
    |         | the implementation of the Serializable interface can be removed.
    |         | (PHPCompatibility.Interfaces.RemovedSerializable.RedundantSerializableImplementation)
----------------------------------------------------------------------------------


FILE: /var/www/html/docroot/themes/contrib/bootstrap/src/SerializedResponse.php
----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
----------------------------------------------------------------------------------
  98 | 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: $request.
     |         | (PHPCompatibility.FunctionDeclarations.RemovedImplicitlyNullableParam.Deprecated)
 127 | 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: $request.
     |         | (PHPCompatibility.FunctionDeclarations.RemovedImplicitlyNullableParam.Deprecated)
 143 | 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: $request.
     |         | (PHPCompatibility.FunctionDeclarations.RemovedImplicitlyNullableParam.Deprecated)
----------------------------------------------------------------------------------


FILE: /var/www/html/docroot/themes/contrib/bootstrap/deprecated.php
----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------
 718 | 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: $target.
     |         | (PHPCompatibility.FunctionDeclarations.RemovedImplicitlyNullableParam.Deprecated)
----------------------------------------------------------------------------------

f1mishutka changed the visibility of the branch issue-3528571-php8.4-compatibility to hidden.

f1mishutka’s picture

Status: Needs review » Reviewed & tested by the community

MR 61 looks good and works for us.

joseph.olstad’s picture

Status: Reviewed & tested by the community » Fixed

This is all merged into the 8.x-3.x dev branch

joseph.olstad’s picture

I'll wait a bit before tagging 3.36

joseph.olstad’s picture

joseph.olstad’s picture

Thanks @hosterholz!

joseph.olstad’s picture

crediting for fix

f1mishutka’s picture

joseph.olstad’s picture

creditted dejan.maric.max and socialnicheguru for their work in the related issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.