Problem/Motivation

PHP 8.4 has deprecated implicit nullable types.

FILE: ../docroot/modules/contrib/acsf/src/AcsfMessageRest.php
---------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS 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: $config.
 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: $callback.
---------------------------------------------------------------------------------------

Steps to reproduce

composer require --dev --with-all-dependencies \
    phpcompatibility/php-compatibility:10.x@dev \
    dealerdirect/phpcodesniffer-composer-installer:^1.1

php bin/phpcs -p -s \
  --standard=PHPCompatibility \
  --runtime-set testVersion 8.4 \
  --extensions="inc,install,module,php,profile,theme" \
  docroot/modules/contrib/acsf

Proposed resolution

Explicitly declare the variable as nullable: https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated

Issue fork acsf-3573848

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

jaswinsingh created an issue. See original summary.

jaswinsingh changed the visibility of the branch 3573848-fix-php-8.4 to hidden.

jaswinsingh’s picture

Status: Active » Needs review