Problem/Motivation

There are a few issues with PHP 8.4, all of them related to the implicitly nullable parameter being deprecated now, requiring an explicit marking declaration.

Checking the code using PHPCompatibility code sniffer:

FILE: /var/www/html/web/modules/contrib/storybook/src/Asset/UnoptimizedAssetResolver.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 49 | 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: $language.
 60 | 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: $language.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/web/modules/contrib/storybook/src/PathProcessor/AbsolutePathProcessor.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 18 | 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.
 18 | 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:
    |         | $bubbleable_metadata.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 82ms; Memory: 6MB

exit status 1

Steps to reproduce

Test the code base with PHPCompatibility code sniffer.

Proposed resolution

Fix deprecations.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Issue fork storybook-3513496

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:

  • 3513496-fix-php-8.4 Comparechanges, plain diff MR !23
  • 1 hidden branch
  • 1.x Comparecompare

Comments

maursilveira created an issue. See original summary.

maursilveira changed the visibility of the branch 1.x to hidden.

maursilveira’s picture

Status: Active » Needs review
StatusFileSize
new1.76 KB

I've created a merge request with the fixes for the PHP 8.4 deprecations.

I'm also attaching here a patch file for the same fixes, for composer patches.

Please let me know if you have any questions. Thank you.

webflo’s picture

Status: Needs review » Reviewed & tested by the community

Looks great!

rajab natshah’s picture

Priority: Normal » Major

Thank you, Tested the fix.
Hoping for a commit and release.

fjgarlin’s picture

+1 for that commit and release.

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

e0ipso’s picture

Status: Reviewed & tested by the community » Fixed

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.

Status: Fixed » Closed (fixed)

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