Problem/Motivation

A major incompatible change in PHP 8.4 will be the deprecation of implicitly nullable types.

See https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullabl... for details.

We need to fix this early while PHP 8.4 is still not released.

Steps to reproduce

Proposed resolution

See #3427999: [PHP 8.4] Fix implicitly nullable type declarations for the equivalent core issue.

Remaining tasks

Do it.

User interface changes

None.

API changes

None.

Data model changes

None.

Issue fork mongodb-3458044

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

fgm created an issue. See original summary.

fgm’s picture

Issue summary: View changes
sourabhsisodia_’s picture

Assigned: Unassigned » sourabhsisodia_

sourabhsisodia_’s picture

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

@fgm Fixed implicitly nullable type declarations in the code , Please review.

fgm’s picture

Status: Needs review » Needs work

@sourabhsisodia_ can you also update the .gitlab-ci.yml to run the checks on PHP 8.4 ?

Also note that this is not just a base module issue, but applies to all the modules in the project. It's just associated to the base module because on d.o. one can only select a single component.

sourabhsisodia_’s picture

@fgm updated the MR according to recommended changes and also checked other submodules for nullable type declarations.

fgm’s picture

Thanks. As you can see, this MR fails https://git.drupalcode.org/issue/mongodb-3458044/-/pipelines/213633/test... so you now need to fix it.

sourabhsisodia_’s picture

@fgm can you please look into the phpunit error , I have tried but not able to solve.

fgm’s picture

This is blocked by #3625939: Fix Drupal 11 / Symfony 7 compatibility errors and failing CI jobs. Once this is merged, your fix should pass without changing anything to the CI bit.

  • fgm committed 17e85454 on 8.x-2.x authored by sourabhsisodia_
    fix: #3458044 [PHP 8.4] Fix implicitly nullable type declarations
    
    By:...
fgm’s picture

Status: Needs work » Fixed

Merged to today's HEAD, thanks.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.