In PHP 8.4, implicitly nullable parameters are deprecated and must be explicitly marked as nullable.

The SettingsForm constructor currently defines:

protected TypedConfigManagerInterface $typedConfigManager

However, ConfigFormBase expects this parameter to be nullable (TypedConfigManagerInterface|null), as reflected in the docblock and parent constructor.

This results in a PHP 8.4 deprecation warning.

Proposed fix:
Update the constructor to explicitly allow null

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

amritsingh09 created an issue. See original summary.

amritsingh09’s picture

Assigned: amritsingh09 » Unassigned
Status: Active » Needs review

Added a fix for the PHP 8.4 nullable parameter deprecation in SettingsForm::__construct(). The TypedConfigManagerInterface parameter is now explicitly nullable to match ConfigFormBase. Needs review.

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

astonvictor’s picture

Status: Needs review » Reviewed & tested by the community

I guess the warning was caused by the @param \Drupal\Core\Config\TypedConfigManagerInterface|null $typedConfigManager comment. So, we can simply remove the null from the comment.

Another solution is to remove the __construct method and create the property directly in the create method. So, I implemented that option.

astonvictor’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.